Average Error: 10.3 → 1.3
Time: 22.6s
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 r25121799 = x;
        double r25121800 = y;
        double r25121801 = z;
        double r25121802 = t;
        double r25121803 = r25121801 - r25121802;
        double r25121804 = r25121800 * r25121803;
        double r25121805 = a;
        double r25121806 = r25121805 - r25121802;
        double r25121807 = r25121804 / r25121806;
        double r25121808 = r25121799 + r25121807;
        return r25121808;
}

double f(double x, double y, double z, double t, double a) {
        double r25121809 = x;
        double r25121810 = y;
        double r25121811 = z;
        double r25121812 = t;
        double r25121813 = r25121811 - r25121812;
        double r25121814 = a;
        double r25121815 = r25121814 - r25121812;
        double r25121816 = r25121813 / r25121815;
        double r25121817 = r25121810 * r25121816;
        double r25121818 = r25121809 + r25121817;
        return r25121818;
}

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

Derivation

  1. Initial program 10.3

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

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

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

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

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

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"

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

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