Average Error: 11.2 → 1.4
Time: 4.2s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\frac{z - t}{a - t} \cdot y + x\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\frac{z - t}{a - t} \cdot y + x
double f(double x, double y, double z, double t, double a) {
        double r624468 = x;
        double r624469 = y;
        double r624470 = z;
        double r624471 = t;
        double r624472 = r624470 - r624471;
        double r624473 = r624469 * r624472;
        double r624474 = a;
        double r624475 = r624474 - r624471;
        double r624476 = r624473 / r624475;
        double r624477 = r624468 + r624476;
        return r624477;
}

double f(double x, double y, double z, double t, double a) {
        double r624478 = z;
        double r624479 = t;
        double r624480 = r624478 - r624479;
        double r624481 = a;
        double r624482 = r624481 - r624479;
        double r624483 = r624480 / r624482;
        double r624484 = y;
        double r624485 = r624483 * r624484;
        double r624486 = x;
        double r624487 = r624485 + r624486;
        return r624487;
}

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.2
Target1.3
Herbie1.4
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Initial program 11.2

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)}\]
  3. Using strategy rm
  4. Applied clear-num3.2

    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{a - t}{y}}}, z - t, x\right)\]
  5. Using strategy rm
  6. Applied fma-udef3.2

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

    \[\leadsto \color{blue}{\frac{z - t}{\frac{a - t}{y}}} + x\]
  8. Using strategy rm
  9. Applied associate-/r/1.4

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

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

Reproduce

herbie shell --seed 2020021 +o rules:numerics
(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))))