Average Error: 10.5 → 1.3
Time: 4.4s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\mathsf{fma}\left(\frac{z - t}{\frac{a - t}{1}}, y, x\right)\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\mathsf{fma}\left(\frac{z - t}{\frac{a - t}{1}}, y, x\right)
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (((double) (y * ((double) (z - t)))) / ((double) (a - t))))));
}
double code(double x, double y, double z, double t, double a) {
	return ((double) fma(((double) (((double) (z - t)) / ((double) (((double) (a - t)) / 1.0)))), y, x));
}

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

Derivation

  1. Initial program 10.5

    \[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 *-un-lft-identity3.0

    \[\leadsto \mathsf{fma}\left(\frac{y}{\color{blue}{1 \cdot \left(a - t\right)}}, z - t, x\right)\]
  5. Applied add-cube-cbrt3.4

    \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}{1 \cdot \left(a - t\right)}, z - t, x\right)\]
  6. Applied times-frac3.4

    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1} \cdot \frac{\sqrt[3]{y}}{a - t}}, z - t, x\right)\]
  7. Simplified3.4

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

    \[\leadsto \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \frac{\sqrt[3]{y}}{a - t}\right) \cdot \left(z - t\right) + x}\]
  10. Simplified2.9

    \[\leadsto \color{blue}{\frac{z - t}{\frac{a - t}{y}}} + x\]
  11. Using strategy rm
  12. Applied *-un-lft-identity2.9

    \[\leadsto \frac{z - t}{\frac{a - t}{\color{blue}{1 \cdot y}}} + x\]
  13. Applied associate-/r*2.9

    \[\leadsto \frac{z - t}{\color{blue}{\frac{\frac{a - t}{1}}{y}}} + x\]
  14. Applied associate-/r/1.3

    \[\leadsto \color{blue}{\frac{z - t}{\frac{a - t}{1}} \cdot y} + x\]
  15. Applied fma-def1.3

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{\frac{a - t}{1}}, y, x\right)}\]
  16. Final simplification1.3

    \[\leadsto \mathsf{fma}\left(\frac{z - t}{\frac{a - t}{1}}, y, x\right)\]

Reproduce

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