Graphics.Rendering.Plot.Render.Plot.Axis:tickPosition from plot-0.2.3.4

Percentage Accurate: 97.6% → 95.9%
Time: 7.3s
Alternatives: 12
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x + \left(y - x\right) \cdot \frac{z}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (* (- y x) (/ z t))))
double code(double x, double y, double z, double t) {
	return x + ((y - x) * (z / t));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y - x) * (z / t))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y - x) * (z / t));
}
def code(x, y, z, t):
	return x + ((y - x) * (z / t))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y - x) * Float64(z / t)))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y - x) * (z / t));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(y - x\right) \cdot \frac{z}{t}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 12 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 97.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \left(y - x\right) \cdot \frac{z}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (* (- y x) (/ z t))))
double code(double x, double y, double z, double t) {
	return x + ((y - x) * (z / t));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y - x) * (z / t))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y - x) * (z / t));
}
def code(x, y, z, t):
	return x + ((y - x) * (z / t))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y - x) * Float64(z / t)))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y - x) * (z / t));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(y - x\right) \cdot \frac{z}{t}
\end{array}

Alternative 1: 95.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -500000000000:\\ \;\;\;\;\frac{y - x}{\frac{t}{z}}\\ \mathbf{elif}\;\frac{z}{t} \leq 10:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ z t) -500000000000.0)
   (/ (- y x) (/ t z))
   (if (<= (/ z t) 10.0) (+ x (* y (/ z t))) (* z (/ (- y x) t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -500000000000.0) {
		tmp = (y - x) / (t / z);
	} else if ((z / t) <= 10.0) {
		tmp = x + (y * (z / t));
	} else {
		tmp = z * ((y - x) / t);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z / t) <= (-500000000000.0d0)) then
        tmp = (y - x) / (t / z)
    else if ((z / t) <= 10.0d0) then
        tmp = x + (y * (z / t))
    else
        tmp = z * ((y - x) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -500000000000.0) {
		tmp = (y - x) / (t / z);
	} else if ((z / t) <= 10.0) {
		tmp = x + (y * (z / t));
	} else {
		tmp = z * ((y - x) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z / t) <= -500000000000.0:
		tmp = (y - x) / (t / z)
	elif (z / t) <= 10.0:
		tmp = x + (y * (z / t))
	else:
		tmp = z * ((y - x) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z / t) <= -500000000000.0)
		tmp = Float64(Float64(y - x) / Float64(t / z));
	elseif (Float64(z / t) <= 10.0)
		tmp = Float64(x + Float64(y * Float64(z / t)));
	else
		tmp = Float64(z * Float64(Float64(y - x) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z / t) <= -500000000000.0)
		tmp = (y - x) / (t / z);
	elseif ((z / t) <= 10.0)
		tmp = x + (y * (z / t));
	else
		tmp = z * ((y - x) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z / t), $MachinePrecision], -500000000000.0], N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 10.0], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -500000000000:\\
\;\;\;\;\frac{y - x}{\frac{t}{z}}\\

\mathbf{elif}\;\frac{z}{t} \leq 10:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\

\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y - x}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 z t) < -5e11

    1. Initial program 97.2%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 94.2%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    3. Step-by-step derivation
      1. *-commutative94.2%

        \[\leadsto \color{blue}{\left(\frac{y}{t} - \frac{x}{t}\right) \cdot z} \]
      2. sub-div95.6%

        \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
      3. associate-/r/97.4%

        \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      4. frac-2neg97.4%

        \[\leadsto \color{blue}{\frac{-\left(y - x\right)}{-\frac{t}{z}}} \]
      5. frac-2neg97.4%

        \[\leadsto \color{blue}{\frac{-\left(-\left(y - x\right)\right)}{-\left(-\frac{t}{z}\right)}} \]
      6. sub-neg97.4%

        \[\leadsto \frac{-\left(-\color{blue}{\left(y + \left(-x\right)\right)}\right)}{-\left(-\frac{t}{z}\right)} \]
      7. distribute-neg-in97.4%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)}}{-\left(-\frac{t}{z}\right)} \]
      8. add-sqr-sqrt52.7%

        \[\leadsto \frac{-\left(\left(-y\right) + \left(-\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}\right)\right)}{-\left(-\frac{t}{z}\right)} \]
      9. sqrt-unprod69.0%

        \[\leadsto \frac{-\left(\left(-y\right) + \left(-\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}\right)\right)}{-\left(-\frac{t}{z}\right)} \]
      10. sqr-neg69.0%

        \[\leadsto \frac{-\left(\left(-y\right) + \left(-\sqrt{\color{blue}{x \cdot x}}\right)\right)}{-\left(-\frac{t}{z}\right)} \]
      11. sqrt-unprod18.7%

        \[\leadsto \frac{-\left(\left(-y\right) + \left(-\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right)\right)}{-\left(-\frac{t}{z}\right)} \]
      12. add-sqr-sqrt50.1%

        \[\leadsto \frac{-\left(\left(-y\right) + \left(-\color{blue}{x}\right)\right)}{-\left(-\frac{t}{z}\right)} \]
      13. add-sqr-sqrt31.4%

        \[\leadsto \frac{-\left(\left(-y\right) + \color{blue}{\sqrt{-x} \cdot \sqrt{-x}}\right)}{-\left(-\frac{t}{z}\right)} \]
      14. sqrt-unprod69.4%

        \[\leadsto \frac{-\left(\left(-y\right) + \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}\right)}{-\left(-\frac{t}{z}\right)} \]
      15. sqr-neg69.4%

        \[\leadsto \frac{-\left(\left(-y\right) + \sqrt{\color{blue}{x \cdot x}}\right)}{-\left(-\frac{t}{z}\right)} \]
      16. sqrt-unprod44.6%

        \[\leadsto \frac{-\left(\left(-y\right) + \color{blue}{\sqrt{x} \cdot \sqrt{x}}\right)}{-\left(-\frac{t}{z}\right)} \]
      17. add-sqr-sqrt97.4%

        \[\leadsto \frac{-\left(\left(-y\right) + \color{blue}{x}\right)}{-\left(-\frac{t}{z}\right)} \]
      18. distribute-neg-frac97.4%

        \[\leadsto \frac{-\left(\left(-y\right) + x\right)}{-\color{blue}{\frac{-t}{z}}} \]
    4. Applied egg-rr97.4%

      \[\leadsto \color{blue}{\frac{-\left(\left(-y\right) + x\right)}{-\frac{-t}{z}}} \]
    5. Step-by-step derivation
      1. distribute-neg-in97.4%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{-\frac{-t}{z}} \]
      2. remove-double-neg97.4%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{-\frac{-t}{z}} \]
      3. sub-neg97.4%

        \[\leadsto \frac{\color{blue}{y - x}}{-\frac{-t}{z}} \]
      4. distribute-neg-frac97.4%

        \[\leadsto \frac{y - x}{\color{blue}{\frac{-\left(-t\right)}{z}}} \]
      5. remove-double-neg97.4%

        \[\leadsto \frac{y - x}{\frac{\color{blue}{t}}{z}} \]
    6. Simplified97.4%

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

    if -5e11 < (/.f64 z t) < 10

    1. Initial program 98.8%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in y around inf 93.2%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    3. Step-by-step derivation
      1. associate-*r/97.8%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    4. Simplified97.8%

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

    if 10 < (/.f64 z t)

    1. Initial program 95.2%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 95.2%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    3. Taylor expanded in y around 0 95.2%

      \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \frac{x}{t} + \frac{y}{t}\right)} \]
    4. Step-by-step derivation
      1. +-commutative95.2%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} + -1 \cdot \frac{x}{t}\right)} \]
      2. mul-1-neg95.2%

        \[\leadsto z \cdot \left(\frac{y}{t} + \color{blue}{\left(-\frac{x}{t}\right)}\right) \]
      3. sub-neg95.2%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} - \frac{x}{t}\right)} \]
      4. div-sub98.5%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
    5. Simplified98.5%

      \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification97.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -500000000000:\\ \;\;\;\;\frac{y - x}{\frac{t}{z}}\\ \mathbf{elif}\;\frac{z}{t} \leq 10:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \end{array} \]

Alternative 2: 63.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot z}{t}\\ t_2 := \frac{z}{t} \cdot \left(-x\right)\\ \mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+176}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq -5 \cdot 10^{+116}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;\frac{z}{t} \leq -4 \cdot 10^{+51}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\frac{z}{t} \leq -0.5:\\ \;\;\;\;t_2\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{-87}:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z}{t} \leq 4 \cdot 10^{+150}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;\frac{z}{t} \leq 10^{+184}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (* y z) t)) (t_2 (* (/ z t) (- x))))
   (if (<= (/ z t) -2e+176)
     (* y (/ z t))
     (if (<= (/ z t) -5e+116)
       t_2
       (if (<= (/ z t) -4e+51)
         t_1
         (if (<= (/ z t) -0.5)
           t_2
           (if (<= (/ z t) 5e-87)
             x
             (if (<= (/ z t) 4e+150)
               (/ y (/ t z))
               (if (<= (/ z t) 1e+184) t_2 t_1)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y * z) / t;
	double t_2 = (z / t) * -x;
	double tmp;
	if ((z / t) <= -2e+176) {
		tmp = y * (z / t);
	} else if ((z / t) <= -5e+116) {
		tmp = t_2;
	} else if ((z / t) <= -4e+51) {
		tmp = t_1;
	} else if ((z / t) <= -0.5) {
		tmp = t_2;
	} else if ((z / t) <= 5e-87) {
		tmp = x;
	} else if ((z / t) <= 4e+150) {
		tmp = y / (t / z);
	} else if ((z / t) <= 1e+184) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (y * z) / t
    t_2 = (z / t) * -x
    if ((z / t) <= (-2d+176)) then
        tmp = y * (z / t)
    else if ((z / t) <= (-5d+116)) then
        tmp = t_2
    else if ((z / t) <= (-4d+51)) then
        tmp = t_1
    else if ((z / t) <= (-0.5d0)) then
        tmp = t_2
    else if ((z / t) <= 5d-87) then
        tmp = x
    else if ((z / t) <= 4d+150) then
        tmp = y / (t / z)
    else if ((z / t) <= 1d+184) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (y * z) / t;
	double t_2 = (z / t) * -x;
	double tmp;
	if ((z / t) <= -2e+176) {
		tmp = y * (z / t);
	} else if ((z / t) <= -5e+116) {
		tmp = t_2;
	} else if ((z / t) <= -4e+51) {
		tmp = t_1;
	} else if ((z / t) <= -0.5) {
		tmp = t_2;
	} else if ((z / t) <= 5e-87) {
		tmp = x;
	} else if ((z / t) <= 4e+150) {
		tmp = y / (t / z);
	} else if ((z / t) <= 1e+184) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y * z) / t
	t_2 = (z / t) * -x
	tmp = 0
	if (z / t) <= -2e+176:
		tmp = y * (z / t)
	elif (z / t) <= -5e+116:
		tmp = t_2
	elif (z / t) <= -4e+51:
		tmp = t_1
	elif (z / t) <= -0.5:
		tmp = t_2
	elif (z / t) <= 5e-87:
		tmp = x
	elif (z / t) <= 4e+150:
		tmp = y / (t / z)
	elif (z / t) <= 1e+184:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y * z) / t)
	t_2 = Float64(Float64(z / t) * Float64(-x))
	tmp = 0.0
	if (Float64(z / t) <= -2e+176)
		tmp = Float64(y * Float64(z / t));
	elseif (Float64(z / t) <= -5e+116)
		tmp = t_2;
	elseif (Float64(z / t) <= -4e+51)
		tmp = t_1;
	elseif (Float64(z / t) <= -0.5)
		tmp = t_2;
	elseif (Float64(z / t) <= 5e-87)
		tmp = x;
	elseif (Float64(z / t) <= 4e+150)
		tmp = Float64(y / Float64(t / z));
	elseif (Float64(z / t) <= 1e+184)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y * z) / t;
	t_2 = (z / t) * -x;
	tmp = 0.0;
	if ((z / t) <= -2e+176)
		tmp = y * (z / t);
	elseif ((z / t) <= -5e+116)
		tmp = t_2;
	elseif ((z / t) <= -4e+51)
		tmp = t_1;
	elseif ((z / t) <= -0.5)
		tmp = t_2;
	elseif ((z / t) <= 5e-87)
		tmp = x;
	elseif ((z / t) <= 4e+150)
		tmp = y / (t / z);
	elseif ((z / t) <= 1e+184)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z / t), $MachinePrecision] * (-x)), $MachinePrecision]}, If[LessEqual[N[(z / t), $MachinePrecision], -2e+176], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], -5e+116], t$95$2, If[LessEqual[N[(z / t), $MachinePrecision], -4e+51], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], -0.5], t$95$2, If[LessEqual[N[(z / t), $MachinePrecision], 5e-87], x, If[LessEqual[N[(z / t), $MachinePrecision], 4e+150], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 1e+184], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y \cdot z}{t}\\
t_2 := \frac{z}{t} \cdot \left(-x\right)\\
\mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+176}:\\
\;\;\;\;y \cdot \frac{z}{t}\\

\mathbf{elif}\;\frac{z}{t} \leq -5 \cdot 10^{+116}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;\frac{z}{t} \leq -4 \cdot 10^{+51}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;\frac{z}{t} \leq -0.5:\\
\;\;\;\;t_2\\

\mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{-87}:\\
\;\;\;\;x\\

\mathbf{elif}\;\frac{z}{t} \leq 4 \cdot 10^{+150}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\

\mathbf{elif}\;\frac{z}{t} \leq 10^{+184}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (/.f64 z t) < -2e176

    1. Initial program 94.4%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 97.3%

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

      \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
    4. Step-by-step derivation
      1. associate-*r/67.8%

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
      2. associate-*l/79.4%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
      3. *-commutative79.4%

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
      4. clear-num79.4%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{t}{z}}} \]
      5. un-div-inv79.3%

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    5. Applied egg-rr79.3%

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity79.3%

        \[\leadsto \frac{\color{blue}{1 \cdot y}}{\frac{t}{z}} \]
      2. associate-*l/79.4%

        \[\leadsto \color{blue}{\frac{1}{\frac{t}{z}} \cdot y} \]
      3. clear-num79.4%

        \[\leadsto \color{blue}{\frac{z}{t}} \cdot y \]
    7. Applied egg-rr79.4%

      \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]

    if -2e176 < (/.f64 z t) < -5.00000000000000025e116 or -4e51 < (/.f64 z t) < -0.5 or 3.99999999999999992e150 < (/.f64 z t) < 1.00000000000000002e184

    1. Initial program 99.8%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 96.1%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    3. Taylor expanded in y around 0 75.5%

      \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \frac{x}{t}\right)} \]
    4. Step-by-step derivation
      1. associate-*r/75.5%

        \[\leadsto z \cdot \color{blue}{\frac{-1 \cdot x}{t}} \]
      2. mul-1-neg75.5%

        \[\leadsto z \cdot \frac{\color{blue}{-x}}{t} \]
    5. Simplified75.5%

      \[\leadsto z \cdot \color{blue}{\frac{-x}{t}} \]
    6. Step-by-step derivation
      1. *-commutative75.5%

        \[\leadsto \color{blue}{\frac{-x}{t} \cdot z} \]
      2. distribute-frac-neg75.5%

        \[\leadsto \color{blue}{\left(-\frac{x}{t}\right)} \cdot z \]
      3. distribute-lft-neg-out75.5%

        \[\leadsto \color{blue}{-\frac{x}{t} \cdot z} \]
      4. add-sqr-sqrt42.1%

        \[\leadsto -\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{t} \cdot z \]
      5. sqrt-unprod34.9%

        \[\leadsto -\frac{\color{blue}{\sqrt{x \cdot x}}}{t} \cdot z \]
      6. sqr-neg34.9%

        \[\leadsto -\frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{t} \cdot z \]
      7. sqrt-unprod0.5%

        \[\leadsto -\frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{t} \cdot z \]
      8. add-sqr-sqrt0.9%

        \[\leadsto -\frac{\color{blue}{-x}}{t} \cdot z \]
      9. div-inv0.9%

        \[\leadsto -\color{blue}{\left(\left(-x\right) \cdot \frac{1}{t}\right)} \cdot z \]
      10. associate-*l*1.0%

        \[\leadsto -\color{blue}{\left(-x\right) \cdot \left(\frac{1}{t} \cdot z\right)} \]
      11. associate-/r/1.0%

        \[\leadsto -\left(-x\right) \cdot \color{blue}{\frac{1}{\frac{t}{z}}} \]
      12. clear-num1.0%

        \[\leadsto -\left(-x\right) \cdot \color{blue}{\frac{z}{t}} \]
      13. add-sqr-sqrt0.5%

        \[\leadsto -\color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{z}{t} \]
      14. sqrt-unprod35.0%

        \[\leadsto -\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{z}{t} \]
      15. sqr-neg35.0%

        \[\leadsto -\sqrt{\color{blue}{x \cdot x}} \cdot \frac{z}{t} \]
      16. sqrt-unprod42.1%

        \[\leadsto -\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{z}{t} \]
      17. add-sqr-sqrt75.8%

        \[\leadsto -\color{blue}{x} \cdot \frac{z}{t} \]
    7. Applied egg-rr75.8%

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

    if -5.00000000000000025e116 < (/.f64 z t) < -4e51 or 1.00000000000000002e184 < (/.f64 z t)

    1. Initial program 93.3%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 91.0%

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

      \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
    4. Step-by-step derivation
      1. associate-*r/65.3%

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
    5. Applied egg-rr65.3%

      \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]

    if -0.5 < (/.f64 z t) < 5.00000000000000042e-87

    1. Initial program 98.7%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around 0 73.9%

      \[\leadsto \color{blue}{x} \]

    if 5.00000000000000042e-87 < (/.f64 z t) < 3.99999999999999992e150

    1. Initial program 99.6%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 72.5%

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

      \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
    4. Step-by-step derivation
      1. associate-*r/60.5%

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
      2. associate-*l/71.0%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
      3. *-commutative71.0%

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
      4. clear-num70.9%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{t}{z}}} \]
      5. un-div-inv71.1%

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    5. Applied egg-rr71.1%

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification72.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+176}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq -5 \cdot 10^{+116}:\\ \;\;\;\;\frac{z}{t} \cdot \left(-x\right)\\ \mathbf{elif}\;\frac{z}{t} \leq -4 \cdot 10^{+51}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq -0.5:\\ \;\;\;\;\frac{z}{t} \cdot \left(-x\right)\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{-87}:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z}{t} \leq 4 \cdot 10^{+150}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;\frac{z}{t} \leq 10^{+184}:\\ \;\;\;\;\frac{z}{t} \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \end{array} \]

Alternative 3: 62.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+176}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq -0.5:\\ \;\;\;\;z \cdot \frac{-x}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{-87}:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z}{t} \leq 4 \cdot 10^{+150}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;\frac{z}{t} \leq 10^{+184}:\\ \;\;\;\;\frac{z}{t} \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ z t) -2e+176)
   (* y (/ z t))
   (if (<= (/ z t) -0.5)
     (* z (/ (- x) t))
     (if (<= (/ z t) 5e-87)
       x
       (if (<= (/ z t) 4e+150)
         (/ y (/ t z))
         (if (<= (/ z t) 1e+184) (* (/ z t) (- x)) (/ (* y z) t)))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -2e+176) {
		tmp = y * (z / t);
	} else if ((z / t) <= -0.5) {
		tmp = z * (-x / t);
	} else if ((z / t) <= 5e-87) {
		tmp = x;
	} else if ((z / t) <= 4e+150) {
		tmp = y / (t / z);
	} else if ((z / t) <= 1e+184) {
		tmp = (z / t) * -x;
	} else {
		tmp = (y * z) / t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z / t) <= (-2d+176)) then
        tmp = y * (z / t)
    else if ((z / t) <= (-0.5d0)) then
        tmp = z * (-x / t)
    else if ((z / t) <= 5d-87) then
        tmp = x
    else if ((z / t) <= 4d+150) then
        tmp = y / (t / z)
    else if ((z / t) <= 1d+184) then
        tmp = (z / t) * -x
    else
        tmp = (y * z) / t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -2e+176) {
		tmp = y * (z / t);
	} else if ((z / t) <= -0.5) {
		tmp = z * (-x / t);
	} else if ((z / t) <= 5e-87) {
		tmp = x;
	} else if ((z / t) <= 4e+150) {
		tmp = y / (t / z);
	} else if ((z / t) <= 1e+184) {
		tmp = (z / t) * -x;
	} else {
		tmp = (y * z) / t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z / t) <= -2e+176:
		tmp = y * (z / t)
	elif (z / t) <= -0.5:
		tmp = z * (-x / t)
	elif (z / t) <= 5e-87:
		tmp = x
	elif (z / t) <= 4e+150:
		tmp = y / (t / z)
	elif (z / t) <= 1e+184:
		tmp = (z / t) * -x
	else:
		tmp = (y * z) / t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z / t) <= -2e+176)
		tmp = Float64(y * Float64(z / t));
	elseif (Float64(z / t) <= -0.5)
		tmp = Float64(z * Float64(Float64(-x) / t));
	elseif (Float64(z / t) <= 5e-87)
		tmp = x;
	elseif (Float64(z / t) <= 4e+150)
		tmp = Float64(y / Float64(t / z));
	elseif (Float64(z / t) <= 1e+184)
		tmp = Float64(Float64(z / t) * Float64(-x));
	else
		tmp = Float64(Float64(y * z) / t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z / t) <= -2e+176)
		tmp = y * (z / t);
	elseif ((z / t) <= -0.5)
		tmp = z * (-x / t);
	elseif ((z / t) <= 5e-87)
		tmp = x;
	elseif ((z / t) <= 4e+150)
		tmp = y / (t / z);
	elseif ((z / t) <= 1e+184)
		tmp = (z / t) * -x;
	else
		tmp = (y * z) / t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z / t), $MachinePrecision], -2e+176], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], -0.5], N[(z * N[((-x) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 5e-87], x, If[LessEqual[N[(z / t), $MachinePrecision], 4e+150], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 1e+184], N[(N[(z / t), $MachinePrecision] * (-x)), $MachinePrecision], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+176}:\\
\;\;\;\;y \cdot \frac{z}{t}\\

\mathbf{elif}\;\frac{z}{t} \leq -0.5:\\
\;\;\;\;z \cdot \frac{-x}{t}\\

\mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{-87}:\\
\;\;\;\;x\\

\mathbf{elif}\;\frac{z}{t} \leq 4 \cdot 10^{+150}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\

\mathbf{elif}\;\frac{z}{t} \leq 10^{+184}:\\
\;\;\;\;\frac{z}{t} \cdot \left(-x\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{y \cdot z}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if (/.f64 z t) < -2e176

    1. Initial program 94.4%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 97.3%

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

      \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
    4. Step-by-step derivation
      1. associate-*r/67.8%

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
      2. associate-*l/79.4%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
      3. *-commutative79.4%

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
      4. clear-num79.4%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{t}{z}}} \]
      5. un-div-inv79.3%

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    5. Applied egg-rr79.3%

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity79.3%

        \[\leadsto \frac{\color{blue}{1 \cdot y}}{\frac{t}{z}} \]
      2. associate-*l/79.4%

        \[\leadsto \color{blue}{\frac{1}{\frac{t}{z}} \cdot y} \]
      3. clear-num79.4%

        \[\leadsto \color{blue}{\frac{z}{t}} \cdot y \]
    7. Applied egg-rr79.4%

      \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]

    if -2e176 < (/.f64 z t) < -0.5

    1. Initial program 99.7%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 91.6%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    3. Taylor expanded in y around 0 65.7%

      \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \frac{x}{t}\right)} \]
    4. Step-by-step derivation
      1. associate-*r/65.7%

        \[\leadsto z \cdot \color{blue}{\frac{-1 \cdot x}{t}} \]
      2. mul-1-neg65.7%

        \[\leadsto z \cdot \frac{\color{blue}{-x}}{t} \]
    5. Simplified65.7%

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

    if -0.5 < (/.f64 z t) < 5.00000000000000042e-87

    1. Initial program 98.7%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around 0 73.9%

      \[\leadsto \color{blue}{x} \]

    if 5.00000000000000042e-87 < (/.f64 z t) < 3.99999999999999992e150

    1. Initial program 99.6%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 72.5%

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

      \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
    4. Step-by-step derivation
      1. associate-*r/60.5%

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
      2. associate-*l/71.0%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
      3. *-commutative71.0%

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
      4. clear-num70.9%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{t}{z}}} \]
      5. un-div-inv71.1%

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    5. Applied egg-rr71.1%

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]

    if 3.99999999999999992e150 < (/.f64 z t) < 1.00000000000000002e184

    1. Initial program 100.0%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 99.5%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    3. Taylor expanded in y around 0 73.3%

      \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \frac{x}{t}\right)} \]
    4. Step-by-step derivation
      1. associate-*r/73.3%

        \[\leadsto z \cdot \color{blue}{\frac{-1 \cdot x}{t}} \]
      2. mul-1-neg73.3%

        \[\leadsto z \cdot \frac{\color{blue}{-x}}{t} \]
    5. Simplified73.3%

      \[\leadsto z \cdot \color{blue}{\frac{-x}{t}} \]
    6. Step-by-step derivation
      1. *-commutative73.3%

        \[\leadsto \color{blue}{\frac{-x}{t} \cdot z} \]
      2. distribute-frac-neg73.3%

        \[\leadsto \color{blue}{\left(-\frac{x}{t}\right)} \cdot z \]
      3. distribute-lft-neg-out73.3%

        \[\leadsto \color{blue}{-\frac{x}{t} \cdot z} \]
      4. add-sqr-sqrt44.4%

        \[\leadsto -\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{t} \cdot z \]
      5. sqrt-unprod45.1%

        \[\leadsto -\frac{\color{blue}{\sqrt{x \cdot x}}}{t} \cdot z \]
      6. sqr-neg45.1%

        \[\leadsto -\frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{t} \cdot z \]
      7. sqrt-unprod0.7%

        \[\leadsto -\frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{t} \cdot z \]
      8. add-sqr-sqrt0.8%

        \[\leadsto -\frac{\color{blue}{-x}}{t} \cdot z \]
      9. div-inv0.8%

        \[\leadsto -\color{blue}{\left(\left(-x\right) \cdot \frac{1}{t}\right)} \cdot z \]
      10. associate-*l*0.8%

        \[\leadsto -\color{blue}{\left(-x\right) \cdot \left(\frac{1}{t} \cdot z\right)} \]
      11. associate-/r/0.8%

        \[\leadsto -\left(-x\right) \cdot \color{blue}{\frac{1}{\frac{t}{z}}} \]
      12. clear-num0.8%

        \[\leadsto -\left(-x\right) \cdot \color{blue}{\frac{z}{t}} \]
      13. add-sqr-sqrt0.7%

        \[\leadsto -\color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{z}{t} \]
      14. sqrt-unprod45.3%

        \[\leadsto -\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{z}{t} \]
      15. sqr-neg45.3%

        \[\leadsto -\sqrt{\color{blue}{x \cdot x}} \cdot \frac{z}{t} \]
      16. sqrt-unprod44.4%

        \[\leadsto -\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{z}{t} \]
      17. add-sqr-sqrt73.8%

        \[\leadsto -\color{blue}{x} \cdot \frac{z}{t} \]
    7. Applied egg-rr73.8%

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

    if 1.00000000000000002e184 < (/.f64 z t)

    1. Initial program 91.0%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 93.6%

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

      \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
    4. Step-by-step derivation
      1. associate-*r/61.5%

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
    5. Applied egg-rr61.5%

      \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification71.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+176}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq -0.5:\\ \;\;\;\;z \cdot \frac{-x}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{-87}:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z}{t} \leq 4 \cdot 10^{+150}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;\frac{z}{t} \leq 10^{+184}:\\ \;\;\;\;\frac{z}{t} \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \end{array} \]

Alternative 4: 82.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{y - x}{t}\\ \mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{-87}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{-43}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 2 \cdot 10^{-29}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (/ (- y x) t))))
   (if (<= (/ z t) -5e-14)
     t_1
     (if (<= (/ z t) 5e-87)
       (* x (- 1.0 (/ z t)))
       (if (<= (/ z t) 5e-43) (* y (/ z t)) (if (<= (/ z t) 2e-29) x t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * ((y - x) / t);
	double tmp;
	if ((z / t) <= -5e-14) {
		tmp = t_1;
	} else if ((z / t) <= 5e-87) {
		tmp = x * (1.0 - (z / t));
	} else if ((z / t) <= 5e-43) {
		tmp = y * (z / t);
	} else if ((z / t) <= 2e-29) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * ((y - x) / t)
    if ((z / t) <= (-5d-14)) then
        tmp = t_1
    else if ((z / t) <= 5d-87) then
        tmp = x * (1.0d0 - (z / t))
    else if ((z / t) <= 5d-43) then
        tmp = y * (z / t)
    else if ((z / t) <= 2d-29) then
        tmp = x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * ((y - x) / t);
	double tmp;
	if ((z / t) <= -5e-14) {
		tmp = t_1;
	} else if ((z / t) <= 5e-87) {
		tmp = x * (1.0 - (z / t));
	} else if ((z / t) <= 5e-43) {
		tmp = y * (z / t);
	} else if ((z / t) <= 2e-29) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * ((y - x) / t)
	tmp = 0
	if (z / t) <= -5e-14:
		tmp = t_1
	elif (z / t) <= 5e-87:
		tmp = x * (1.0 - (z / t))
	elif (z / t) <= 5e-43:
		tmp = y * (z / t)
	elif (z / t) <= 2e-29:
		tmp = x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(Float64(y - x) / t))
	tmp = 0.0
	if (Float64(z / t) <= -5e-14)
		tmp = t_1;
	elseif (Float64(z / t) <= 5e-87)
		tmp = Float64(x * Float64(1.0 - Float64(z / t)));
	elseif (Float64(z / t) <= 5e-43)
		tmp = Float64(y * Float64(z / t));
	elseif (Float64(z / t) <= 2e-29)
		tmp = x;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * ((y - x) / t);
	tmp = 0.0;
	if ((z / t) <= -5e-14)
		tmp = t_1;
	elseif ((z / t) <= 5e-87)
		tmp = x * (1.0 - (z / t));
	elseif ((z / t) <= 5e-43)
		tmp = y * (z / t);
	elseif ((z / t) <= 2e-29)
		tmp = x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z / t), $MachinePrecision], -5e-14], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], 5e-87], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 5e-43], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 2e-29], x, t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \frac{y - x}{t}\\
\mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-14}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{-87}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\

\mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{-43}:\\
\;\;\;\;y \cdot \frac{z}{t}\\

\mathbf{elif}\;\frac{z}{t} \leq 2 \cdot 10^{-29}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 z t) < -5.0000000000000002e-14 or 1.99999999999999989e-29 < (/.f64 z t)

    1. Initial program 96.5%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 91.8%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    3. Taylor expanded in y around 0 91.8%

      \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \frac{x}{t} + \frac{y}{t}\right)} \]
    4. Step-by-step derivation
      1. +-commutative91.8%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} + -1 \cdot \frac{x}{t}\right)} \]
      2. mul-1-neg91.8%

        \[\leadsto z \cdot \left(\frac{y}{t} + \color{blue}{\left(-\frac{x}{t}\right)}\right) \]
      3. sub-neg91.8%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} - \frac{x}{t}\right)} \]
      4. div-sub93.9%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
    5. Simplified93.9%

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

    if -5.0000000000000002e-14 < (/.f64 z t) < 5.00000000000000042e-87

    1. Initial program 98.7%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in x around inf 76.4%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z}{t}\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg76.4%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\frac{z}{t}\right)}\right) \]
      2. unsub-neg76.4%

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z}{t}\right)} \]
    4. Simplified76.4%

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

    if 5.00000000000000042e-87 < (/.f64 z t) < 5.00000000000000019e-43

    1. Initial program 99.5%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 62.0%

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

      \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
    4. Step-by-step derivation
      1. associate-*r/63.1%

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
      2. associate-*l/83.5%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
      3. *-commutative83.5%

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
      4. clear-num83.5%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{t}{z}}} \]
      5. un-div-inv83.5%

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    5. Applied egg-rr83.5%

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity83.5%

        \[\leadsto \frac{\color{blue}{1 \cdot y}}{\frac{t}{z}} \]
      2. associate-*l/83.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{t}{z}} \cdot y} \]
      3. clear-num83.5%

        \[\leadsto \color{blue}{\frac{z}{t}} \cdot y \]
    7. Applied egg-rr83.5%

      \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]

    if 5.00000000000000019e-43 < (/.f64 z t) < 1.99999999999999989e-29

    1. Initial program 100.0%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around 0 100.0%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification86.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-14}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{-87}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{-43}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 2 \cdot 10^{-29}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \end{array} \]

Alternative 5: 72.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -8.2 \cdot 10^{-26} \lor \neg \left(x \leq 1.04 \cdot 10^{-103} \lor \neg \left(x \leq 1.2 \cdot 10^{-8}\right) \land x \leq 4 \cdot 10^{+28}\right):\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -8.2e-26)
         (not (or (<= x 1.04e-103) (and (not (<= x 1.2e-8)) (<= x 4e+28)))))
   (* x (- 1.0 (/ z t)))
   (/ y (/ t z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -8.2e-26) || !((x <= 1.04e-103) || (!(x <= 1.2e-8) && (x <= 4e+28)))) {
		tmp = x * (1.0 - (z / t));
	} else {
		tmp = y / (t / z);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((x <= (-8.2d-26)) .or. (.not. (x <= 1.04d-103) .or. (.not. (x <= 1.2d-8)) .and. (x <= 4d+28))) then
        tmp = x * (1.0d0 - (z / t))
    else
        tmp = y / (t / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -8.2e-26) || !((x <= 1.04e-103) || (!(x <= 1.2e-8) && (x <= 4e+28)))) {
		tmp = x * (1.0 - (z / t));
	} else {
		tmp = y / (t / z);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -8.2e-26) or not ((x <= 1.04e-103) or (not (x <= 1.2e-8) and (x <= 4e+28))):
		tmp = x * (1.0 - (z / t))
	else:
		tmp = y / (t / z)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -8.2e-26) || !((x <= 1.04e-103) || (!(x <= 1.2e-8) && (x <= 4e+28))))
		tmp = Float64(x * Float64(1.0 - Float64(z / t)));
	else
		tmp = Float64(y / Float64(t / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x <= -8.2e-26) || ~(((x <= 1.04e-103) || (~((x <= 1.2e-8)) && (x <= 4e+28)))))
		tmp = x * (1.0 - (z / t));
	else
		tmp = y / (t / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -8.2e-26], N[Not[Or[LessEqual[x, 1.04e-103], And[N[Not[LessEqual[x, 1.2e-8]], $MachinePrecision], LessEqual[x, 4e+28]]]], $MachinePrecision]], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.2 \cdot 10^{-26} \lor \neg \left(x \leq 1.04 \cdot 10^{-103} \lor \neg \left(x \leq 1.2 \cdot 10^{-8}\right) \land x \leq 4 \cdot 10^{+28}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.1999999999999997e-26 or 1.04000000000000001e-103 < x < 1.19999999999999999e-8 or 3.99999999999999983e28 < x

    1. Initial program 99.2%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in x around inf 87.3%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z}{t}\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg87.3%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\frac{z}{t}\right)}\right) \]
      2. unsub-neg87.3%

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z}{t}\right)} \]
    4. Simplified87.3%

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

    if -8.1999999999999997e-26 < x < 1.04000000000000001e-103 or 1.19999999999999999e-8 < x < 3.99999999999999983e28

    1. Initial program 95.4%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 75.9%

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

      \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
    4. Step-by-step derivation
      1. associate-*r/68.8%

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
      2. associate-*l/75.3%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
      3. *-commutative75.3%

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
      4. clear-num75.3%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{t}{z}}} \]
      5. un-div-inv75.5%

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    5. Applied egg-rr75.5%

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification82.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.2 \cdot 10^{-26} \lor \neg \left(x \leq 1.04 \cdot 10^{-103} \lor \neg \left(x \leq 1.2 \cdot 10^{-8}\right) \land x \leq 4 \cdot 10^{+28}\right):\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \end{array} \]

Alternative 6: 95.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -500000000000 \lor \neg \left(\frac{z}{t} \leq 10\right):\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= (/ z t) -500000000000.0) (not (<= (/ z t) 10.0)))
   (* z (/ (- y x) t))
   (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((z / t) <= -500000000000.0) || !((z / t) <= 10.0)) {
		tmp = z * ((y - x) / t);
	} else {
		tmp = x + (y * (z / t));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (((z / t) <= (-500000000000.0d0)) .or. (.not. ((z / t) <= 10.0d0))) then
        tmp = z * ((y - x) / t)
    else
        tmp = x + (y * (z / t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (((z / t) <= -500000000000.0) || !((z / t) <= 10.0)) {
		tmp = z * ((y - x) / t);
	} else {
		tmp = x + (y * (z / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((z / t) <= -500000000000.0) or not ((z / t) <= 10.0):
		tmp = z * ((y - x) / t)
	else:
		tmp = x + (y * (z / t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((Float64(z / t) <= -500000000000.0) || !(Float64(z / t) <= 10.0))
		tmp = Float64(z * Float64(Float64(y - x) / t));
	else
		tmp = Float64(x + Float64(y * Float64(z / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (((z / t) <= -500000000000.0) || ~(((z / t) <= 10.0)))
		tmp = z * ((y - x) / t);
	else
		tmp = x + (y * (z / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z / t), $MachinePrecision], -500000000000.0], N[Not[LessEqual[N[(z / t), $MachinePrecision], 10.0]], $MachinePrecision]], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -500000000000 \lor \neg \left(\frac{z}{t} \leq 10\right):\\
\;\;\;\;z \cdot \frac{y - x}{t}\\

\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 z t) < -5e11 or 10 < (/.f64 z t)

    1. Initial program 96.3%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 94.6%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    3. Taylor expanded in y around 0 94.6%

      \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \frac{x}{t} + \frac{y}{t}\right)} \]
    4. Step-by-step derivation
      1. +-commutative94.6%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} + -1 \cdot \frac{x}{t}\right)} \]
      2. mul-1-neg94.6%

        \[\leadsto z \cdot \left(\frac{y}{t} + \color{blue}{\left(-\frac{x}{t}\right)}\right) \]
      3. sub-neg94.6%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} - \frac{x}{t}\right)} \]
      4. div-sub96.9%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
    5. Simplified96.9%

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

    if -5e11 < (/.f64 z t) < 10

    1. Initial program 98.8%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in y around inf 93.2%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    3. Step-by-step derivation
      1. associate-*r/97.8%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    4. Simplified97.8%

      \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -500000000000 \lor \neg \left(\frac{z}{t} \leq 10\right):\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \end{array} \]

Alternative 7: 64.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-14} \lor \neg \left(\frac{z}{t} \leq 5 \cdot 10^{-87}\right):\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= (/ z t) -5e-14) (not (<= (/ z t) 5e-87))) (* y (/ z t)) x))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((z / t) <= -5e-14) || !((z / t) <= 5e-87)) {
		tmp = y * (z / t);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (((z / t) <= (-5d-14)) .or. (.not. ((z / t) <= 5d-87))) then
        tmp = y * (z / t)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (((z / t) <= -5e-14) || !((z / t) <= 5e-87)) {
		tmp = y * (z / t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((z / t) <= -5e-14) or not ((z / t) <= 5e-87):
		tmp = y * (z / t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((Float64(z / t) <= -5e-14) || !(Float64(z / t) <= 5e-87))
		tmp = Float64(y * Float64(z / t));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (((z / t) <= -5e-14) || ~(((z / t) <= 5e-87)))
		tmp = y * (z / t);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z / t), $MachinePrecision], -5e-14], N[Not[LessEqual[N[(z / t), $MachinePrecision], 5e-87]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-14} \lor \neg \left(\frac{z}{t} \leq 5 \cdot 10^{-87}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 z t) < -5.0000000000000002e-14 or 5.00000000000000042e-87 < (/.f64 z t)

    1. Initial program 96.8%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 87.8%

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

      \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
    4. Step-by-step derivation
      1. associate-*r/53.9%

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
      2. associate-*l/60.5%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
      3. *-commutative60.5%

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
      4. clear-num60.5%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{t}{z}}} \]
      5. un-div-inv60.6%

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    5. Applied egg-rr60.6%

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity60.6%

        \[\leadsto \frac{\color{blue}{1 \cdot y}}{\frac{t}{z}} \]
      2. associate-*l/60.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{t}{z}} \cdot y} \]
      3. clear-num60.5%

        \[\leadsto \color{blue}{\frac{z}{t}} \cdot y \]
    7. Applied egg-rr60.5%

      \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]

    if -5.0000000000000002e-14 < (/.f64 z t) < 5.00000000000000042e-87

    1. Initial program 98.7%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around 0 76.3%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-14} \lor \neg \left(\frac{z}{t} \leq 5 \cdot 10^{-87}\right):\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 8: 64.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-14} \lor \neg \left(\frac{z}{t} \leq 5 \cdot 10^{-87}\right):\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= (/ z t) -5e-14) (not (<= (/ z t) 5e-87))) (/ y (/ t z)) x))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((z / t) <= -5e-14) || !((z / t) <= 5e-87)) {
		tmp = y / (t / z);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (((z / t) <= (-5d-14)) .or. (.not. ((z / t) <= 5d-87))) then
        tmp = y / (t / z)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (((z / t) <= -5e-14) || !((z / t) <= 5e-87)) {
		tmp = y / (t / z);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((z / t) <= -5e-14) or not ((z / t) <= 5e-87):
		tmp = y / (t / z)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((Float64(z / t) <= -5e-14) || !(Float64(z / t) <= 5e-87))
		tmp = Float64(y / Float64(t / z));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (((z / t) <= -5e-14) || ~(((z / t) <= 5e-87)))
		tmp = y / (t / z);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z / t), $MachinePrecision], -5e-14], N[Not[LessEqual[N[(z / t), $MachinePrecision], 5e-87]], $MachinePrecision]], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-14} \lor \neg \left(\frac{z}{t} \leq 5 \cdot 10^{-87}\right):\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 z t) < -5.0000000000000002e-14 or 5.00000000000000042e-87 < (/.f64 z t)

    1. Initial program 96.8%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 87.8%

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

      \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
    4. Step-by-step derivation
      1. associate-*r/53.9%

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
      2. associate-*l/60.5%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
      3. *-commutative60.5%

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
      4. clear-num60.5%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{t}{z}}} \]
      5. un-div-inv60.6%

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    5. Applied egg-rr60.6%

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]

    if -5.0000000000000002e-14 < (/.f64 z t) < 5.00000000000000042e-87

    1. Initial program 98.7%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around 0 76.3%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-14} \lor \neg \left(\frac{z}{t} \leq 5 \cdot 10^{-87}\right):\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 9: 52.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{-155} \lor \neg \left(z \leq 2.22 \cdot 10^{+30}\right):\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -1.7e-155) (not (<= z 2.22e+30))) (* z (/ y t)) x))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.7e-155) || !(z <= 2.22e+30)) {
		tmp = z * (y / t);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-1.7d-155)) .or. (.not. (z <= 2.22d+30))) then
        tmp = z * (y / t)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.7e-155) || !(z <= 2.22e+30)) {
		tmp = z * (y / t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -1.7e-155) or not (z <= 2.22e+30):
		tmp = z * (y / t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1.7e-155) || !(z <= 2.22e+30))
		tmp = Float64(z * Float64(y / t));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -1.7e-155) || ~((z <= 2.22e+30)))
		tmp = z * (y / t);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.7e-155], N[Not[LessEqual[z, 2.22e+30]], $MachinePrecision]], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-155} \lor \neg \left(z \leq 2.22 \cdot 10^{+30}\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7e-155 or 2.22e30 < z

    1. Initial program 96.9%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around inf 81.5%

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

      \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]

    if -1.7e-155 < z < 2.22e30

    1. Initial program 98.6%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Taylor expanded in z around 0 62.4%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification56.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{-155} \lor \neg \left(z \leq 2.22 \cdot 10^{+30}\right):\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 10: 97.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{y - x}{\frac{t}{z}} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (/ (- y x) (/ t z))))
double code(double x, double y, double z, double t) {
	return x + ((y - x) / (t / z));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y - x) / (t / z))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y - x) / (t / z));
}
def code(x, y, z, t):
	return x + ((y - x) / (t / z))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y - x) / Float64(t / z)))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y - x) / (t / z));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{y - x}{\frac{t}{z}}
\end{array}
Derivation
  1. Initial program 97.5%

    \[x + \left(y - x\right) \cdot \frac{z}{t} \]
  2. Taylor expanded in y around 0 87.7%

    \[\leadsto x + \color{blue}{\left(-1 \cdot \frac{x \cdot z}{t} + \frac{y \cdot z}{t}\right)} \]
  3. Step-by-step derivation
    1. +-commutative87.7%

      \[\leadsto x + \color{blue}{\left(\frac{y \cdot z}{t} + -1 \cdot \frac{x \cdot z}{t}\right)} \]
    2. mul-1-neg87.7%

      \[\leadsto x + \left(\frac{y \cdot z}{t} + \color{blue}{\left(-\frac{x \cdot z}{t}\right)}\right) \]
    3. sub-neg87.7%

      \[\leadsto x + \color{blue}{\left(\frac{y \cdot z}{t} - \frac{x \cdot z}{t}\right)} \]
    4. associate-/l*88.9%

      \[\leadsto x + \left(\color{blue}{\frac{y}{\frac{t}{z}}} - \frac{x \cdot z}{t}\right) \]
    5. associate-/l*91.8%

      \[\leadsto x + \left(\frac{y}{\frac{t}{z}} - \color{blue}{\frac{x}{\frac{t}{z}}}\right) \]
    6. div-sub97.7%

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
  4. Simplified97.7%

    \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
  5. Final simplification97.7%

    \[\leadsto x + \frac{y - x}{\frac{t}{z}} \]

Alternative 11: 97.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \left(y - x\right) \cdot \frac{z}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (* (- y x) (/ z t))))
double code(double x, double y, double z, double t) {
	return x + ((y - x) * (z / t));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y - x) * (z / t))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y - x) * (z / t));
}
def code(x, y, z, t):
	return x + ((y - x) * (z / t))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y - x) * Float64(z / t)))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y - x) * (z / t));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(y - x\right) \cdot \frac{z}{t}
\end{array}
Derivation
  1. Initial program 97.5%

    \[x + \left(y - x\right) \cdot \frac{z}{t} \]
  2. Final simplification97.5%

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

Alternative 12: 39.3% accurate, 9.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
	return x;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x
end function
public static double code(double x, double y, double z, double t) {
	return x;
}
def code(x, y, z, t):
	return x
function code(x, y, z, t)
	return x
end
function tmp = code(x, y, z, t)
	tmp = x;
end
code[x_, y_, z_, t_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 97.5%

    \[x + \left(y - x\right) \cdot \frac{z}{t} \]
  2. Taylor expanded in z around 0 33.9%

    \[\leadsto \color{blue}{x} \]
  3. Final simplification33.9%

    \[\leadsto x \]

Developer target: 97.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - x\right) \cdot \frac{z}{t}\\ t_2 := x + \frac{y - x}{\frac{t}{z}}\\ \mathbf{if}\;t_1 < -1013646692435.8867:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 < 0:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- y x) (/ z t))) (t_2 (+ x (/ (- y x) (/ t z)))))
   (if (< t_1 -1013646692435.8867)
     t_2
     (if (< t_1 0.0) (+ x (/ (* (- y x) z) t)) t_2))))
double code(double x, double y, double z, double t) {
	double t_1 = (y - x) * (z / t);
	double t_2 = x + ((y - x) / (t / z));
	double tmp;
	if (t_1 < -1013646692435.8867) {
		tmp = t_2;
	} else if (t_1 < 0.0) {
		tmp = x + (((y - x) * z) / t);
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (y - x) * (z / t)
    t_2 = x + ((y - x) / (t / z))
    if (t_1 < (-1013646692435.8867d0)) then
        tmp = t_2
    else if (t_1 < 0.0d0) then
        tmp = x + (((y - x) * z) / t)
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (y - x) * (z / t);
	double t_2 = x + ((y - x) / (t / z));
	double tmp;
	if (t_1 < -1013646692435.8867) {
		tmp = t_2;
	} else if (t_1 < 0.0) {
		tmp = x + (((y - x) * z) / t);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y - x) * (z / t)
	t_2 = x + ((y - x) / (t / z))
	tmp = 0
	if t_1 < -1013646692435.8867:
		tmp = t_2
	elif t_1 < 0.0:
		tmp = x + (((y - x) * z) / t)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y - x) * Float64(z / t))
	t_2 = Float64(x + Float64(Float64(y - x) / Float64(t / z)))
	tmp = 0.0
	if (t_1 < -1013646692435.8867)
		tmp = t_2;
	elseif (t_1 < 0.0)
		tmp = Float64(x + Float64(Float64(Float64(y - x) * z) / t));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y - x) * (z / t);
	t_2 = x + ((y - x) / (t / z));
	tmp = 0.0;
	if (t_1 < -1013646692435.8867)
		tmp = t_2;
	elseif (t_1 < 0.0)
		tmp = x + (((y - x) * z) / t);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$1, -1013646692435.8867], t$95$2, If[Less[t$95$1, 0.0], N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(y - x\right) \cdot \frac{z}{t}\\
t_2 := x + \frac{y - x}{\frac{t}{z}}\\
\mathbf{if}\;t_1 < -1013646692435.8867:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_1 < 0:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023308 
(FPCore (x y z t)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:tickPosition from plot-0.2.3.4"
  :precision binary64

  :herbie-target
  (if (< (* (- y x) (/ z t)) -1013646692435.8867) (+ x (/ (- y x) (/ t z))) (if (< (* (- y x) (/ z t)) 0.0) (+ x (/ (* (- y x) z) t)) (+ x (/ (- y x) (/ t z)))))

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