Average Error: 28.6 → 0.1
Time: 6.6s
Precision: 64
\[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\]
\[\frac{\frac{x + z}{\frac{y}{x - z}} + y}{2}\]
\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
\frac{\frac{x + z}{\frac{y}{x - z}} + y}{2}
double f(double x, double y, double z) {
        double r794861 = x;
        double r794862 = r794861 * r794861;
        double r794863 = y;
        double r794864 = r794863 * r794863;
        double r794865 = r794862 + r794864;
        double r794866 = z;
        double r794867 = r794866 * r794866;
        double r794868 = r794865 - r794867;
        double r794869 = 2.0;
        double r794870 = r794863 * r794869;
        double r794871 = r794868 / r794870;
        return r794871;
}

double f(double x, double y, double z) {
        double r794872 = x;
        double r794873 = z;
        double r794874 = r794872 + r794873;
        double r794875 = y;
        double r794876 = r794872 - r794873;
        double r794877 = r794875 / r794876;
        double r794878 = r794874 / r794877;
        double r794879 = r794878 + r794875;
        double r794880 = 2.0;
        double r794881 = r794879 / r794880;
        return r794881;
}

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

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

Derivation

  1. Initial program 28.6

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

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

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

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

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

Reproduce

herbie shell --seed 2020045 
(FPCore (x y z)
  :name "Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, A"
  :precision binary64

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

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