Average Error: 24.8 → 9.8
Time: 6.1s
Precision: binary64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} = -inf.0:\\ \;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -4.9093530599536229 \cdot 10^{-303}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\ \mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 3.95359974261469992 \cdot 10^{-231}:\\ \;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \left(\frac{t - x}{\sqrt[3]{a - z}} \cdot \frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}}\right)\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} = -inf.0:\\
\;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\

\mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -4.9093530599536229 \cdot 10^{-303}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\

\mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 3.95359974261469992 \cdot 10^{-231}:\\
\;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z))))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if ((((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z)))))) <= -inf.0)) {
		VAR = ((double) (t + ((double) (((double) (y / z)) * ((double) (x - t))))));
	} else {
		double VAR_1;
		if ((((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z)))))) <= -4.909353059953623e-303)) {
			VAR_1 = ((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z))))));
		} else {
			double VAR_2;
			if ((((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z)))))) <= 3.9535997426147e-231)) {
				VAR_2 = ((double) (t + ((double) (((double) (y / z)) * ((double) (x - t))))));
			} else {
				VAR_2 = ((double) (x + ((double) (((double) (((double) (((double) cbrt(((double) (y - z)))) * ((double) cbrt(((double) (y - z)))))) / ((double) cbrt(((double) (a - z)))))) * ((double) (((double) (((double) (t - x)) / ((double) cbrt(((double) (a - z)))))) * ((double) (((double) cbrt(((double) (y - z)))) / ((double) cbrt(((double) (a - z))))))))))));
			}
			VAR_1 = VAR_2;
		}
		VAR = VAR_1;
	}
	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

Original24.8
Target12.4
Herbie9.8
\[\begin{array}{l} \mathbf{if}\;z \lt -1.25361310560950359 \cdot 10^{188}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \mathbf{elif}\;z \lt 4.44670236911381103 \cdot 10^{64}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if (+ x (/ (* (- y z) (- t x)) (- a z))) < -inf.0 or -4.9093530599536229e-303 < (+ x (/ (* (- y z) (- t x)) (- a z))) < 3.95359974261469992e-231

    1. Initial program 60.6

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

      \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}}\]
    3. Taylor expanded around inf 32.0

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

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

    if -inf.0 < (+ x (/ (* (- y z) (- t x)) (- a z))) < -4.9093530599536229e-303

    1. Initial program 2.0

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

    if 3.95359974261469992e-231 < (+ x (/ (* (- y z) (- t x)) (- a z)))

    1. Initial program 21.6

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

      \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt11.0

      \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{\left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right) \cdot \sqrt[3]{a - z}}}\]
    5. Applied *-un-lft-identity11.0

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

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\]
    9. Using strategy rm
    10. Applied add-cube-cbrt8.0

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} = -inf.0:\\ \;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -4.9093530599536229 \cdot 10^{-303}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\ \mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 3.95359974261469992 \cdot 10^{-231}:\\ \;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \left(\frac{t - x}{\sqrt[3]{a - z}} \cdot \frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020184 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (if (< z -1.2536131056095036e+188) (- t (* (/ y z) (- t x))) (if (< z 4.446702369113811e+64) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x)))))

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