Average Error: 12.2 → 3.0
Time: 9.1s
Precision: 64
\[\frac{x \cdot \left(y + z\right)}{z}\]
\[x \cdot \frac{y + z}{z}\]
\frac{x \cdot \left(y + z\right)}{z}
x \cdot \frac{y + z}{z}
double f(double x, double y, double z) {
        double r285558 = x;
        double r285559 = y;
        double r285560 = z;
        double r285561 = r285559 + r285560;
        double r285562 = r285558 * r285561;
        double r285563 = r285562 / r285560;
        return r285563;
}

double f(double x, double y, double z) {
        double r285564 = x;
        double r285565 = y;
        double r285566 = z;
        double r285567 = r285565 + r285566;
        double r285568 = r285567 / r285566;
        double r285569 = r285564 * r285568;
        return r285569;
}

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

Original12.2
Target2.7
Herbie3.0
\[\frac{x}{\frac{z}{y + z}}\]

Derivation

  1. Split input into 2 regimes
  2. if y < 8.331233029980697e+104 or 2.871906439667942e+163 < y

    1. Initial program 12.4

      \[\frac{x \cdot \left(y + z\right)}{z}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity12.4

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

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

      \[\leadsto \color{blue}{x} \cdot \frac{y + z}{z}\]

    if 8.331233029980697e+104 < y < 2.871906439667942e+163

    1. Initial program 7.8

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z} + x}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification3.0

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

Reproduce

herbie shell --seed 2019298 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
  :precision binary64

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

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