The code being generated was just stupid, considering that:
- normalize(x) = 1.0
- length(x) = x
- distance(x, y) = x - y
(parameters
(declare (in) float p0)
(declare (in) float p1))
- ((declare () float p)
- (assign (constant bool (1)) (x) (var_ref p) (expression float - (var_ref p0) (var_ref p1)))
- (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))
+ ((return (expression float - (var_ref p0) (var_ref p1)))))
(signature float
(parameters
(signature float
(parameters
(declare (in) float arg0))
- ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))
+ ((return (var_ref arg0))))
(signature float
(parameters
(signature float
(parameters
(declare (in) float arg0))
- ((return (expression float * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))
+ ((return (constant float (1.0)))))
(signature vec2
(parameters