Average Error: 11.9 → 1.7
Time: 12.8s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{y}\]
\[x + \frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y}}{z}} \cdot \frac{-\sqrt[3]{x}}{\frac{\sqrt[3]{y}}{\frac{\sqrt[3]{x}}{\sqrt[3]{y}}}}\]
\frac{x \cdot \left(y - z\right)}{y}
x + \frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y}}{z}} \cdot \frac{-\sqrt[3]{x}}{\frac{\sqrt[3]{y}}{\frac{\sqrt[3]{x}}{\sqrt[3]{y}}}}
double f(double x, double y, double z) {
        double r646264 = x;
        double r646265 = y;
        double r646266 = z;
        double r646267 = r646265 - r646266;
        double r646268 = r646264 * r646267;
        double r646269 = r646268 / r646265;
        return r646269;
}

double f(double x, double y, double z) {
        double r646270 = x;
        double r646271 = cbrt(r646270);
        double r646272 = y;
        double r646273 = cbrt(r646272);
        double r646274 = z;
        double r646275 = r646273 / r646274;
        double r646276 = r646271 / r646275;
        double r646277 = -r646271;
        double r646278 = r646271 / r646273;
        double r646279 = r646273 / r646278;
        double r646280 = r646277 / r646279;
        double r646281 = r646276 * r646280;
        double r646282 = r646270 + r646281;
        return r646282;
}

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

Original11.9
Target3.1
Herbie1.7
\[\begin{array}{l} \mathbf{if}\;z \lt -2.060202331921739024383612783691266533098 \cdot 10^{104}:\\ \;\;\;\;x - \frac{z \cdot x}{y}\\ \mathbf{elif}\;z \lt 1.693976601382852594702773997610248441465 \cdot 10^{213}:\\ \;\;\;\;\frac{x}{\frac{y}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{y}\\ \end{array}\]

Derivation

  1. Initial program 11.9

    \[\frac{x \cdot \left(y - z\right)}{y}\]
  2. Simplified3.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{z}{y}, x\right)}\]
  3. Using strategy rm
  4. Applied fma-udef3.0

    \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{z}{y} + x}\]
  5. Using strategy rm
  6. Applied *-un-lft-identity3.0

    \[\leadsto \left(-x\right) \cdot \frac{z}{\color{blue}{1 \cdot y}} + x\]
  7. Applied add-cube-cbrt3.4

    \[\leadsto \left(-x\right) \cdot \frac{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}{1 \cdot y} + x\]
  8. Applied times-frac3.4

    \[\leadsto \left(-x\right) \cdot \color{blue}{\left(\frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{1} \cdot \frac{\sqrt[3]{z}}{y}\right)} + x\]
  9. Applied associate-*r*3.7

    \[\leadsto \color{blue}{\left(\left(-x\right) \cdot \frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{1}\right) \cdot \frac{\sqrt[3]{z}}{y}} + x\]
  10. Simplified3.7

    \[\leadsto \color{blue}{\left(\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \left(-x\right)\right)} \cdot \frac{\sqrt[3]{z}}{y} + x\]
  11. Taylor expanded around 0 4.6

    \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z}{y}} + x\]
  12. Simplified2.8

    \[\leadsto \color{blue}{\frac{-x}{\frac{y}{z}}} + x\]
  13. Using strategy rm
  14. Applied *-un-lft-identity2.8

    \[\leadsto \frac{-x}{\frac{y}{\color{blue}{1 \cdot z}}} + x\]
  15. Applied add-cube-cbrt3.2

    \[\leadsto \frac{-x}{\frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}{1 \cdot z}} + x\]
  16. Applied times-frac3.2

    \[\leadsto \frac{-x}{\color{blue}{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1} \cdot \frac{\sqrt[3]{y}}{z}}} + x\]
  17. Applied add-cube-cbrt3.3

    \[\leadsto \frac{-\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1} \cdot \frac{\sqrt[3]{y}}{z}} + x\]
  18. Applied distribute-rgt-neg-in3.3

    \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(-\sqrt[3]{x}\right)}}{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1} \cdot \frac{\sqrt[3]{y}}{z}} + x\]
  19. Applied times-frac1.7

    \[\leadsto \color{blue}{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1}} \cdot \frac{-\sqrt[3]{x}}{\frac{\sqrt[3]{y}}{z}}} + x\]
  20. Simplified1.7

    \[\leadsto \color{blue}{\frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y}}{\frac{\sqrt[3]{x}}{\sqrt[3]{y}}}}} \cdot \frac{-\sqrt[3]{x}}{\frac{\sqrt[3]{y}}{z}} + x\]
  21. Final simplification1.7

    \[\leadsto x + \frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y}}{z}} \cdot \frac{-\sqrt[3]{x}}{\frac{\sqrt[3]{y}}{\frac{\sqrt[3]{x}}{\sqrt[3]{y}}}}\]

Reproduce

herbie shell --seed 2019179 +o rules:numerics
(FPCore (x y z)
  :name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"

  :herbie-target
  (if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y))))

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