Average Error: 1.6 → 1.6
Time: 5.6s
Precision: 64
$\frac{x0}{\sqrt{\left(x0 \cdot x1 + y0 \cdot y1\right) + z0 \cdot z1}}$
$\frac{x0}{\sqrt{\left(x0 \cdot x1 + y0 \cdot y1\right) + z0 \cdot z1}}$
\frac{x0}{\sqrt{\left(x0 \cdot x1 + y0 \cdot y1\right) + z0 \cdot z1}}
\frac{x0}{\sqrt{\left(x0 \cdot x1 + y0 \cdot y1\right) + z0 \cdot z1}}
double f(double x0, double x1, double y0, double y1, double z0, double z1) {
double r1787117 = x0;
double r1787118 = x1;
double r1787119 = r1787117 * r1787118;
double r1787120 = y0;
double r1787121 = y1;
double r1787122 = r1787120 * r1787121;
double r1787123 = r1787119 + r1787122;
double r1787124 = z0;
double r1787125 = z1;
double r1787126 = r1787124 * r1787125;
double r1787127 = r1787123 + r1787126;
double r1787128 = sqrt(r1787127);
double r1787129 = r1787117 / r1787128;
return r1787129;
}


double f(double x0, double x1, double y0, double y1, double z0, double z1) {
double r1787130 = x0;
double r1787131 = x1;
double r1787132 = r1787130 * r1787131;
double r1787133 = y0;
double r1787134 = y1;
double r1787135 = r1787133 * r1787134;
double r1787136 = r1787132 + r1787135;
double r1787137 = z0;
double r1787138 = z1;
double r1787139 = r1787137 * r1787138;
double r1787140 = r1787136 + r1787139;
double r1787141 = sqrt(r1787140);
double r1787142 = r1787130 / r1787141;
return r1787142;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 1.6

$\frac{x0}{\sqrt{\left(x0 \cdot x1 + y0 \cdot y1\right) + z0 \cdot z1}}$
2. Final simplification1.6

$\leadsto \frac{x0}{\sqrt{\left(x0 \cdot x1 + y0 \cdot y1\right) + z0 \cdot z1}}$

# Reproduce

herbie shell --seed 1
(FPCore (x0 x1 y0 y1 z0 z1)
:name "x0 / sqrt( x0 * x1 + y0 * y1 + z0 * z1)"
:precision binary32
(/ x0 (sqrt (+ (+ (* x0 x1) (* y0 y1)) (* z0 z1)))))