Average Error: 0.0 → 0.0
Time: 8.8s
Precision: 64
$\left(x \cdot ptx + y \cdot pty\right) + z \cdot ptz$
$\left(x \cdot ptx + y \cdot pty\right) + z \cdot ptz$
\left(x \cdot ptx + y \cdot pty\right) + z \cdot ptz
\left(x \cdot ptx + y \cdot pty\right) + z \cdot ptz
double f(double x, double ptx, double y, double pty, double z, double ptz) {
double r2483239 = x;
double r2483240 = ptx;
double r2483241 = r2483239 * r2483240;
double r2483242 = y;
double r2483243 = pty;
double r2483244 = r2483242 * r2483243;
double r2483245 = r2483241 + r2483244;
double r2483246 = z;
double r2483247 = ptz;
double r2483248 = r2483246 * r2483247;
double r2483249 = r2483245 + r2483248;
return r2483249;
}


double f(double x, double ptx, double y, double pty, double z, double ptz) {
double r2483250 = x;
double r2483251 = ptx;
double r2483252 = r2483250 * r2483251;
double r2483253 = y;
double r2483254 = pty;
double r2483255 = r2483253 * r2483254;
double r2483256 = r2483252 + r2483255;
double r2483257 = z;
double r2483258 = ptz;
double r2483259 = r2483257 * r2483258;
double r2483260 = r2483256 + r2483259;
return r2483260;
}



Try it out

Results

 In Out
Enter valid numbers for all inputs

Derivation

1. Initial program 0.0

$\left(x \cdot ptx + y \cdot pty\right) + z \cdot ptz$
2. Final simplification0.0

$\leadsto \left(x \cdot ptx + y \cdot pty\right) + z \cdot ptz$

Reproduce

herbie shell --seed 1
(FPCore (x ptx y pty z ptz)
:name "x*ptx + y*pty + z*ptz"
:precision binary64
(+ (+ (* x ptx) (* y pty)) (* z ptz)))