Average Error: 10.5 → 0.5
Time: 4.1s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \le -4.16821903091809114 \cdot 10^{-47} \lor \neg \left(y \le 1.5894593416801174 \cdot 10^{-57}\right):\\ \;\;\;\;\frac{z - t}{a - t} \cdot y + x\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{a - t} \cdot \left(\left(z - t\right) \cdot y\right) + x\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;y \le -4.16821903091809114 \cdot 10^{-47} \lor \neg \left(y \le 1.5894593416801174 \cdot 10^{-57}\right):\\
\;\;\;\;\frac{z - t}{a - t} \cdot y + x\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{a - t} \cdot \left(\left(z - t\right) \cdot y\right) + x\\

\end{array}
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) {
	double VAR;
	if (((y <= -4.168219030918091e-47) || !(y <= 1.5894593416801174e-57))) {
		VAR = ((double) (((double) (((double) (((double) (z - t)) / ((double) (a - t)))) * y)) + x));
	} else {
		VAR = ((double) (((double) (((double) (1.0 / ((double) (a - t)))) * ((double) (((double) (z - t)) * y)))) + x));
	}
	return VAR;
}

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

Derivation

  1. Split input into 2 regimes
  2. if y < -4.168219030918091e-47 or 1.5894593416801174e-57 < y

    1. Initial program 18.9

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

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

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

      \[\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.3

      \[\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.3

      \[\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.3

      \[\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.5

      \[\leadsto \color{blue}{\frac{z - t}{\frac{a - t}{y}}} + x\]
    11. Using strategy rm
    12. Applied associate-/r/0.6

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

    if -4.168219030918091e-47 < y < 1.5894593416801174e-57

    1. Initial program 0.4

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

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

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

      \[\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.9

      \[\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.9

      \[\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.9

      \[\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. Simplified4.0

      \[\leadsto \color{blue}{\frac{z - t}{\frac{a - t}{y}}} + x\]
    11. Using strategy rm
    12. Applied div-inv4.0

      \[\leadsto \frac{z - t}{\color{blue}{\left(a - t\right) \cdot \frac{1}{y}}} + x\]
    13. Applied *-un-lft-identity4.0

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

      \[\leadsto \color{blue}{\frac{1}{a - t} \cdot \frac{z - t}{\frac{1}{y}}} + x\]
    15. Simplified0.4

      \[\leadsto \frac{1}{a - t} \cdot \color{blue}{\left(\left(z - t\right) \cdot y\right)} + x\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -4.16821903091809114 \cdot 10^{-47} \lor \neg \left(y \le 1.5894593416801174 \cdot 10^{-57}\right):\\ \;\;\;\;\frac{z - t}{a - t} \cdot y + x\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{a - t} \cdot \left(\left(z - t\right) \cdot y\right) + x\\ \end{array}\]

Reproduce

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