Average Error: 28.2 → 0.1
Time: 4.0s
Precision: 64
\[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\]
\[0.5 \cdot \left(\left(y + \frac{{x}^{1}}{\frac{y}{x}}\right) - \frac{z}{\frac{y}{z}}\right)\]
\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
0.5 \cdot \left(\left(y + \frac{{x}^{1}}{\frac{y}{x}}\right) - \frac{z}{\frac{y}{z}}\right)
double f(double x, double y, double z) {
        double r748412 = x;
        double r748413 = r748412 * r748412;
        double r748414 = y;
        double r748415 = r748414 * r748414;
        double r748416 = r748413 + r748415;
        double r748417 = z;
        double r748418 = r748417 * r748417;
        double r748419 = r748416 - r748418;
        double r748420 = 2.0;
        double r748421 = r748414 * r748420;
        double r748422 = r748419 / r748421;
        return r748422;
}

double f(double x, double y, double z) {
        double r748423 = 0.5;
        double r748424 = y;
        double r748425 = x;
        double r748426 = 1.0;
        double r748427 = pow(r748425, r748426);
        double r748428 = r748424 / r748425;
        double r748429 = r748427 / r748428;
        double r748430 = r748424 + r748429;
        double r748431 = z;
        double r748432 = r748424 / r748431;
        double r748433 = r748431 / r748432;
        double r748434 = r748430 - r748433;
        double r748435 = r748423 * r748434;
        return r748435;
}

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.2
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.2

    \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\]
  2. Taylor expanded around 0 12.3

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

    \[\leadsto \color{blue}{0.5 \cdot \left(\left(y + \frac{{x}^{2}}{y}\right) - \frac{{z}^{2}}{y}\right)}\]
  4. Using strategy rm
  5. Applied sqr-pow12.3

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

    \[\leadsto 0.5 \cdot \left(\left(y + \color{blue}{\frac{{x}^{\left(\frac{2}{2}\right)}}{\frac{y}{{x}^{\left(\frac{2}{2}\right)}}}}\right) - \frac{{z}^{2}}{y}\right)\]
  7. Simplified6.9

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{{x}^{\left(\frac{2}{2}\right)}}{\color{blue}{\frac{y}{x}}}\right) - \frac{{z}^{2}}{y}\right)\]
  8. Using strategy rm
  9. Applied unpow26.9

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

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{{x}^{\left(\frac{2}{2}\right)}}{\frac{y}{x}}\right) - \color{blue}{\frac{z}{\frac{y}{z}}}\right)\]
  11. Final simplification0.1

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{{x}^{1}}{\frac{y}{x}}\right) - \frac{z}{\frac{y}{z}}\right)\]

Reproduce

herbie shell --seed 2020027 
(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)))