Average Error: 24.6 → 10.5
Time: 5.3s
Precision: binary64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -8.80426897056057865 \cdot 10^{-31}:\\ \;\;\;\;x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\\ \mathbf{elif}\;a \le -6.0634665926229038 \cdot 10^{-122}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \mathbf{elif}\;a \le -5.9951198603825959 \cdot 10^{-141}:\\ \;\;\;\;x + \left(\left(y - z\right) \cdot \left(t - x\right)\right) \cdot \frac{1}{a - z}\\ \mathbf{elif}\;a \le 2.9536675567106517 \cdot 10^{-219}:\\ \;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le -8.80426897056057865 \cdot 10^{-31}:\\
\;\;\;\;x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\\

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

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

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

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

\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 ((a <= -8.804268970560579e-31)) {
		VAR = ((double) (x + ((double) (((double) (((double) (y - z)) / ((double) (((double) cbrt(((double) (a - z)))) * ((double) cbrt(((double) (a - z)))))))) * ((double) (((double) (t - x)) / ((double) cbrt(((double) (a - z))))))))));
	} else {
		double VAR_1;
		if ((a <= -6.063466592622904e-122)) {
			VAR_1 = ((double) (t + ((double) (y * ((double) (((double) (x / z)) - ((double) (t / z))))))));
		} else {
			double VAR_2;
			if ((a <= -5.995119860382596e-141)) {
				VAR_2 = ((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) * ((double) (1.0 / ((double) (a - z))))))));
			} else {
				double VAR_3;
				if ((a <= 2.953667556710652e-219)) {
					VAR_3 = ((double) (t + ((double) (((double) (y / z)) * ((double) (x - t))))));
				} else {
					VAR_3 = ((double) (x + ((double) (((double) (((double) (y - z)) / ((double) (((double) cbrt(((double) (a - z)))) * ((double) cbrt(((double) (a - z)))))))) * ((double) (((double) (t - x)) / ((double) cbrt(((double) (a - z))))))))));
				}
				VAR_2 = VAR_3;
			}
			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.6
Target11.3
Herbie10.5
\[\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 4 regimes
  2. if a < -8.80426897056057865e-31 or 2.9536675567106517e-219 < a

    1. Initial program 23.1

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

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

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

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

      \[\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*9.5

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

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

    if -8.80426897056057865e-31 < a < -6.0634665926229038e-122

    1. Initial program 27.0

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

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

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

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

    if -6.0634665926229038e-122 < a < -5.9951198603825959e-141

    1. Initial program 26.0

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

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

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

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

    if -5.9951198603825959e-141 < a < 2.9536675567106517e-219

    1. Initial program 29.6

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -8.80426897056057865 \cdot 10^{-31}:\\ \;\;\;\;x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\\ \mathbf{elif}\;a \le -6.0634665926229038 \cdot 10^{-122}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \mathbf{elif}\;a \le -5.9951198603825959 \cdot 10^{-141}:\\ \;\;\;\;x + \left(\left(y - z\right) \cdot \left(t - x\right)\right) \cdot \frac{1}{a - z}\\ \mathbf{elif}\;a \le 2.9536675567106517 \cdot 10^{-219}:\\ \;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\\ \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))))