Average Error: 27.9 → 0.2
Time: 34.5s
Precision: 64
\[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\]
\[\frac{y - \frac{z + x}{\frac{y}{z - x}}}{2}\]
\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
\frac{y - \frac{z + x}{\frac{y}{z - x}}}{2}
double f(double x, double y, double z) {
        double r92189375 = x;
        double r92189376 = r92189375 * r92189375;
        double r92189377 = y;
        double r92189378 = r92189377 * r92189377;
        double r92189379 = r92189376 + r92189378;
        double r92189380 = z;
        double r92189381 = r92189380 * r92189380;
        double r92189382 = r92189379 - r92189381;
        double r92189383 = 2.0;
        double r92189384 = r92189377 * r92189383;
        double r92189385 = r92189382 / r92189384;
        return r92189385;
}

double f(double x, double y, double z) {
        double r92189386 = y;
        double r92189387 = z;
        double r92189388 = x;
        double r92189389 = r92189387 + r92189388;
        double r92189390 = r92189387 - r92189388;
        double r92189391 = r92189386 / r92189390;
        double r92189392 = r92189389 / r92189391;
        double r92189393 = r92189386 - r92189392;
        double r92189394 = 2.0;
        double r92189395 = r92189393 / r92189394;
        return r92189395;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original27.9
Target0.2
Herbie0.2
\[y \cdot 0.5 - \left(\frac{0.5}{y} \cdot \left(z + x\right)\right) \cdot \left(z - x\right)\]

Derivation

  1. Initial program 27.9

    \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\]
  2. Simplified12.3

    \[\leadsto \color{blue}{\frac{y - \frac{z \cdot z - x \cdot x}{y}}{2}}\]
  3. Using strategy rm
  4. Applied difference-of-squares12.3

    \[\leadsto \frac{y - \frac{\color{blue}{\left(z + x\right) \cdot \left(z - x\right)}}{y}}{2}\]
  5. Applied associate-/l*0.2

    \[\leadsto \frac{y - \color{blue}{\frac{z + x}{\frac{y}{z - x}}}}{2}\]
  6. Final simplification0.2

    \[\leadsto \frac{y - \frac{z + x}{\frac{y}{z - x}}}{2}\]

Reproduce

herbie shell --seed 2019173 +o rules:numerics
(FPCore (x y z)
  :name "Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, A"

  :herbie-target
  (- (* y 0.5) (* (* (/ 0.5 y) (+ z x)) (- z x)))

  (/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0)))