Average Error: 10.8 → 1.2
Time: 7.4s
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 r1879 = x;
        double r1880 = y;
        double r1881 = z;
        double r1882 = t;
        double r1883 = r1881 - r1882;
        double r1884 = r1880 * r1883;
        double r1885 = a;
        double r1886 = r1885 - r1882;
        double r1887 = r1884 / r1886;
        double r1888 = r1879 + r1887;
        return r1888;
}

double f(double x, double y, double z, double t, double a) {
        double r1889 = y;
        double r1890 = z;
        double r1891 = t;
        double r1892 = r1890 - r1891;
        double r1893 = a;
        double r1894 = r1893 - r1891;
        double r1895 = r1892 / r1894;
        double r1896 = r1889 * r1895;
        double r1897 = x;
        double r1898 = r1896 + r1897;
        return r1898;
}

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

Derivation

  1. Initial program 10.8

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

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

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

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

    \[\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 2020025 +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))))