Average Error: 10.2 → 1.2
Time: 19.8s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[y \cdot \frac{z - t}{a - t} + x\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
y \cdot \frac{z - t}{a - t} + x
double f(double x, double y, double z, double t, double a) {
        double r25076066 = x;
        double r25076067 = y;
        double r25076068 = z;
        double r25076069 = t;
        double r25076070 = r25076068 - r25076069;
        double r25076071 = r25076067 * r25076070;
        double r25076072 = a;
        double r25076073 = r25076072 - r25076069;
        double r25076074 = r25076071 / r25076073;
        double r25076075 = r25076066 + r25076074;
        return r25076075;
}

double f(double x, double y, double z, double t, double a) {
        double r25076076 = y;
        double r25076077 = z;
        double r25076078 = t;
        double r25076079 = r25076077 - r25076078;
        double r25076080 = a;
        double r25076081 = r25076080 - r25076078;
        double r25076082 = r25076079 / r25076081;
        double r25076083 = r25076076 * r25076082;
        double r25076084 = x;
        double r25076085 = r25076083 + r25076084;
        return r25076085;
}

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

Derivation

  1. Initial program 10.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 fma-udef3.0

    \[\leadsto \color{blue}{\frac{y}{a - t} \cdot \left(z - t\right) + x}\]
  5. Using strategy rm
  6. Applied div-inv3.1

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

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

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

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

Reproduce

herbie shell --seed 2019163 +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))))