Average Error: 10.7 → 0.9
Time: 4.4s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;z \le -4.7559515486135571 \cdot 10^{160}:\\ \;\;\;\;\frac{y}{a - t} \cdot \left(z - t\right) + x\\ \mathbf{elif}\;z \le 2.9821745485608074 \cdot 10^{182}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t} + x\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \left(\frac{\sqrt[3]{y}}{\sqrt[3]{a - t}} \cdot \left(z - t\right)\right) + x\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;z \le -4.7559515486135571 \cdot 10^{160}:\\
\;\;\;\;\frac{y}{a - t} \cdot \left(z - t\right) + x\\

\mathbf{elif}\;z \le 2.9821745485608074 \cdot 10^{182}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t} + x\\

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return (x + ((y * (z - t)) / (a - t)));
}
double code(double x, double y, double z, double t, double a) {
	double temp;
	if ((z <= -4.755951548613557e+160)) {
		temp = (((y / (a - t)) * (z - t)) + x);
	} else {
		double temp_1;
		if ((z <= 2.9821745485608074e+182)) {
			temp_1 = ((y * ((z - t) / (a - t))) + x);
		} else {
			temp_1 = ((((cbrt(y) * cbrt(y)) / (cbrt((a - t)) * cbrt((a - t)))) * ((cbrt(y) / cbrt((a - t))) * (z - t))) + x);
		}
		temp = temp_1;
	}
	return temp;
}

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

Derivation

  1. Split input into 3 regimes
  2. if z < -4.755951548613557e+160

    1. Initial program 16.6

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

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

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

    if -4.755951548613557e+160 < z < 2.9821745485608074e+182

    1. Initial program 9.1

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

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

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

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

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

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

    if 2.9821745485608074e+182 < z

    1. Initial program 19.5

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

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

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

      \[\leadsto \frac{y}{\color{blue}{\left(\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}\right) \cdot \sqrt[3]{a - t}}} \cdot \left(z - t\right) + x\]
    7. Applied add-cube-cbrt4.8

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}{\left(\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}\right) \cdot \sqrt[3]{a - t}} \cdot \left(z - t\right) + x\]
    8. Applied times-frac4.8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -4.7559515486135571 \cdot 10^{160}:\\ \;\;\;\;\frac{y}{a - t} \cdot \left(z - t\right) + x\\ \mathbf{elif}\;z \le 2.9821745485608074 \cdot 10^{182}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t} + x\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \left(\frac{\sqrt[3]{y}}{\sqrt[3]{a - t}} \cdot \left(z - t\right)\right) + x\\ \end{array}\]

Reproduce

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