Average Error: 10.4 → 1.2
Time: 5.9s
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 r330060 = x;
        double r330061 = y;
        double r330062 = z;
        double r330063 = t;
        double r330064 = r330062 - r330063;
        double r330065 = r330061 * r330064;
        double r330066 = a;
        double r330067 = r330066 - r330063;
        double r330068 = r330065 / r330067;
        double r330069 = r330060 + r330068;
        return r330069;
}

double f(double x, double y, double z, double t, double a) {
        double r330070 = x;
        double r330071 = y;
        double r330072 = z;
        double r330073 = t;
        double r330074 = r330072 - r330073;
        double r330075 = a;
        double r330076 = r330075 - r330073;
        double r330077 = r330074 / r330076;
        double r330078 = r330071 * r330077;
        double r330079 = r330070 + r330078;
        return r330079;
}

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

Original10.4
Target1.1
Herbie1.2
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Initial program 10.4

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

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

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

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

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

Reproduce

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