Average Error: 28.8 → 0.1
Time: 3.7s
Precision: 64
\[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\]
\[0.5 \cdot \left(\left(y + \left|x\right| \cdot \frac{\left|x\right|}{y}\right) - \left|z\right| \cdot \frac{\left|z\right|}{y}\right)\]
\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
0.5 \cdot \left(\left(y + \left|x\right| \cdot \frac{\left|x\right|}{y}\right) - \left|z\right| \cdot \frac{\left|z\right|}{y}\right)
double f(double x, double y, double z) {
        double r646283 = x;
        double r646284 = r646283 * r646283;
        double r646285 = y;
        double r646286 = r646285 * r646285;
        double r646287 = r646284 + r646286;
        double r646288 = z;
        double r646289 = r646288 * r646288;
        double r646290 = r646287 - r646289;
        double r646291 = 2.0;
        double r646292 = r646285 * r646291;
        double r646293 = r646290 / r646292;
        return r646293;
}

double f(double x, double y, double z) {
        double r646294 = 0.5;
        double r646295 = y;
        double r646296 = x;
        double r646297 = fabs(r646296);
        double r646298 = r646297 / r646295;
        double r646299 = r646297 * r646298;
        double r646300 = r646295 + r646299;
        double r646301 = z;
        double r646302 = fabs(r646301);
        double r646303 = r646302 / r646295;
        double r646304 = r646302 * r646303;
        double r646305 = r646300 - r646304;
        double r646306 = r646294 * r646305;
        return r646306;
}

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

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

    \[\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.9

    \[\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 *-un-lft-identity12.9

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{{x}^{2}}{\color{blue}{1 \cdot y}}\right) - \frac{{z}^{2}}{y}\right)\]
  6. Applied add-sqr-sqrt12.9

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

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

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

    \[\leadsto 0.5 \cdot \left(\left(y + \left|x\right| \cdot \color{blue}{\frac{\left|x\right|}{y}}\right) - \frac{{z}^{2}}{y}\right)\]
  10. Using strategy rm
  11. Applied *-un-lft-identity7.0

    \[\leadsto 0.5 \cdot \left(\left(y + \left|x\right| \cdot \frac{\left|x\right|}{y}\right) - \frac{{z}^{2}}{\color{blue}{1 \cdot y}}\right)\]
  12. Applied add-sqr-sqrt7.0

    \[\leadsto 0.5 \cdot \left(\left(y + \left|x\right| \cdot \frac{\left|x\right|}{y}\right) - \frac{\color{blue}{\sqrt{{z}^{2}} \cdot \sqrt{{z}^{2}}}}{1 \cdot y}\right)\]
  13. Applied times-frac7.0

    \[\leadsto 0.5 \cdot \left(\left(y + \left|x\right| \cdot \frac{\left|x\right|}{y}\right) - \color{blue}{\frac{\sqrt{{z}^{2}}}{1} \cdot \frac{\sqrt{{z}^{2}}}{y}}\right)\]
  14. Simplified7.0

    \[\leadsto 0.5 \cdot \left(\left(y + \left|x\right| \cdot \frac{\left|x\right|}{y}\right) - \color{blue}{\left|z\right|} \cdot \frac{\sqrt{{z}^{2}}}{y}\right)\]
  15. Simplified0.1

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

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

Reproduce

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