Average Error: 11.0 → 1.5
Time: 4.5s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[x + y \cdot \frac{z - t}{a - t}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
x + y \cdot \frac{z - t}{a - t}
double f(double x, double y, double z, double t, double a) {
        double r612543 = x;
        double r612544 = y;
        double r612545 = z;
        double r612546 = t;
        double r612547 = r612545 - r612546;
        double r612548 = r612544 * r612547;
        double r612549 = a;
        double r612550 = r612549 - r612546;
        double r612551 = r612548 / r612550;
        double r612552 = r612543 + r612551;
        return r612552;
}

double f(double x, double y, double z, double t, double a) {
        double r612553 = x;
        double r612554 = y;
        double r612555 = z;
        double r612556 = t;
        double r612557 = r612555 - r612556;
        double r612558 = a;
        double r612559 = r612558 - r612556;
        double r612560 = r612557 / r612559;
        double r612561 = r612554 * r612560;
        double r612562 = r612553 + r612561;
        return r612562;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original11.0
Target1.3
Herbie1.5
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Initial program 11.0

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

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

    \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{z - t}{a - t}}\]
  5. Simplified1.5

    \[\leadsto x + \color{blue}{y} \cdot \frac{z - t}{a - t}\]
  6. Final simplification1.5

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

Reproduce

herbie shell --seed 2020003 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
  :precision binary64

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

  (+ x (/ (* y (- z t)) (- a t))))