Average Error: 10.5 → 0.2
Time: 3.4s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{z - a} = -\infty \lor \neg \left(\frac{y \cdot \left(z - t\right)}{z - a} \le 4.1106340762642846 \cdot 10^{302}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{z - a}
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{z - a} = -\infty \lor \neg \left(\frac{y \cdot \left(z - t\right)}{z - a} \le 4.1106340762642846 \cdot 10^{302}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)\\

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a))))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if (((((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a)))) <= -inf.0) || !(((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a)))) <= 4.110634076264285e+302))) {
		VAR = ((double) fma(((double) (y / ((double) (z - a)))), ((double) (z - t)), x));
	} else {
		VAR = ((double) (x + ((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a))))));
	}
	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.2
Herbie0.2
\[x + \frac{y}{\frac{z - a}{z - t}}\]

Derivation

  1. Split input into 2 regimes
  2. if (/ (* y (- z t)) (- z a)) < -inf.0 or 4.110634076264285e+302 < (/ (* y (- z t)) (- z a))

    1. Initial program 63.7

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{z - a}{y}}}, z - t, x\right)\]
    5. Using strategy rm
    6. Applied clear-num0.3

      \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\frac{1}{\frac{y}{z - a}}}}, z - t, x\right)\]
    7. Applied remove-double-div0.3

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

    if -inf.0 < (/ (* y (- z t)) (- z a)) < 4.110634076264285e+302

    1. Initial program 0.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{z - a} = -\infty \lor \neg \left(\frac{y \cdot \left(z - t\right)}{z - a} \le 4.1106340762642846 \cdot 10^{302}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\ \end{array}\]

Reproduce

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

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

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