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

Percentage Accurate: 97.4% → 98.3%
Time: 9.0s
Alternatives: 14
Speedup: 0.5×

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 14 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.4% 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: 98.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x + \left(y - x\right) \cdot \frac{z}{t} \leq 4 \cdot 10^{+306}:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(y - x\right) \cdot z}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (+ x (* (- y x) (/ z t))) 4e+306)
   (+ x (/ (- y x) (/ t z)))
   (/ (* (- y x) z) t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x + ((y - x) * (z / t))) <= 4e+306) {
		tmp = x + ((y - x) / (t / z));
	} else {
		tmp = ((y - x) * 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 ((x + ((y - x) * (z / t))) <= 4d+306) then
        tmp = x + ((y - x) / (t / z))
    else
        tmp = ((y - x) * z) / t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x + ((y - x) * (z / t))) <= 4e+306) {
		tmp = x + ((y - x) / (t / z));
	} else {
		tmp = ((y - x) * z) / t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x + ((y - x) * (z / t))) <= 4e+306:
		tmp = x + ((y - x) / (t / z))
	else:
		tmp = ((y - x) * z) / t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(x + Float64(Float64(y - x) * Float64(z / t))) <= 4e+306)
		tmp = Float64(x + Float64(Float64(y - x) / Float64(t / z)));
	else
		tmp = Float64(Float64(Float64(y - x) * z) / t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x + ((y - x) * (z / t))) <= 4e+306)
		tmp = x + ((y - x) / (t / z));
	else
		tmp = ((y - x) * z) / t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4e+306], N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x + \left(y - x\right) \cdot \frac{z}{t} \leq 4 \cdot 10^{+306}:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (*.f64 (-.f64 y x) (/.f64 z t))) < 4.00000000000000007e306

    1. Initial program 98.1%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Step-by-step derivation
      1. clear-num98.1%

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

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
    3. Applied egg-rr98.1%

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

    if 4.00000000000000007e306 < (+.f64 x (*.f64 (-.f64 y x) (/.f64 z t)))

    1. Initial program 84.7%

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

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

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

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

Alternative 2: 61.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{-x}{t}\\ \mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+224}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\frac{z}{t} \leq -5 \cdot 10^{-70}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;\frac{z}{t} \leq 10^{-105}:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+22}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+215} \lor \neg \left(\frac{z}{t} \leq 10^{+272}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (/ (- x) t))))
   (if (<= (/ z t) -2e+224)
     t_1
     (if (<= (/ z t) -5e-70)
       (/ y (/ t z))
       (if (<= (/ z t) 1e-105)
         x
         (if (<= (/ z t) 5e+22)
           (* y (/ z t))
           (if (or (<= (/ z t) 5e+215) (not (<= (/ z t) 1e+272)))
             t_1
             (* z (/ y t)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (-x / t);
	double tmp;
	if ((z / t) <= -2e+224) {
		tmp = t_1;
	} else if ((z / t) <= -5e-70) {
		tmp = y / (t / z);
	} else if ((z / t) <= 1e-105) {
		tmp = x;
	} else if ((z / t) <= 5e+22) {
		tmp = y * (z / t);
	} else if (((z / t) <= 5e+215) || !((z / t) <= 1e+272)) {
		tmp = t_1;
	} else {
		tmp = z * (y / 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) :: t_1
    real(8) :: tmp
    t_1 = z * (-x / t)
    if ((z / t) <= (-2d+224)) then
        tmp = t_1
    else if ((z / t) <= (-5d-70)) then
        tmp = y / (t / z)
    else if ((z / t) <= 1d-105) then
        tmp = x
    else if ((z / t) <= 5d+22) then
        tmp = y * (z / t)
    else if (((z / t) <= 5d+215) .or. (.not. ((z / t) <= 1d+272))) then
        tmp = t_1
    else
        tmp = z * (y / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * (-x / t);
	double tmp;
	if ((z / t) <= -2e+224) {
		tmp = t_1;
	} else if ((z / t) <= -5e-70) {
		tmp = y / (t / z);
	} else if ((z / t) <= 1e-105) {
		tmp = x;
	} else if ((z / t) <= 5e+22) {
		tmp = y * (z / t);
	} else if (((z / t) <= 5e+215) || !((z / t) <= 1e+272)) {
		tmp = t_1;
	} else {
		tmp = z * (y / t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (-x / t)
	tmp = 0
	if (z / t) <= -2e+224:
		tmp = t_1
	elif (z / t) <= -5e-70:
		tmp = y / (t / z)
	elif (z / t) <= 1e-105:
		tmp = x
	elif (z / t) <= 5e+22:
		tmp = y * (z / t)
	elif ((z / t) <= 5e+215) or not ((z / t) <= 1e+272):
		tmp = t_1
	else:
		tmp = z * (y / t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(Float64(-x) / t))
	tmp = 0.0
	if (Float64(z / t) <= -2e+224)
		tmp = t_1;
	elseif (Float64(z / t) <= -5e-70)
		tmp = Float64(y / Float64(t / z));
	elseif (Float64(z / t) <= 1e-105)
		tmp = x;
	elseif (Float64(z / t) <= 5e+22)
		tmp = Float64(y * Float64(z / t));
	elseif ((Float64(z / t) <= 5e+215) || !(Float64(z / t) <= 1e+272))
		tmp = t_1;
	else
		tmp = Float64(z * Float64(y / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * (-x / t);
	tmp = 0.0;
	if ((z / t) <= -2e+224)
		tmp = t_1;
	elseif ((z / t) <= -5e-70)
		tmp = y / (t / z);
	elseif ((z / t) <= 1e-105)
		tmp = x;
	elseif ((z / t) <= 5e+22)
		tmp = y * (z / t);
	elseif (((z / t) <= 5e+215) || ~(((z / t) <= 1e+272)))
		tmp = t_1;
	else
		tmp = z * (y / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[((-x) / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z / t), $MachinePrecision], -2e+224], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], -5e-70], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 1e-105], x, If[LessEqual[N[(z / t), $MachinePrecision], 5e+22], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(z / t), $MachinePrecision], 5e+215], N[Not[LessEqual[N[(z / t), $MachinePrecision], 1e+272]], $MachinePrecision]], t$95$1, N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \frac{-x}{t}\\
\mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+224}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;\frac{z}{t} \leq 10^{-105}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+215} \lor \neg \left(\frac{z}{t} \leq 10^{+272}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (/.f64 z t) < -1.99999999999999994e224 or 4.9999999999999996e22 < (/.f64 z t) < 5.0000000000000001e215 or 1.0000000000000001e272 < (/.f64 z t)

    1. Initial program 92.4%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x}{t}\right)} \cdot z \]
      2. distribute-neg-frac69.7%

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

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

    if -1.99999999999999994e224 < (/.f64 z t) < -4.9999999999999998e-70

    1. Initial program 99.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
    6. Taylor expanded in y around inf 51.4%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    8. Simplified60.8%

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

    if -4.9999999999999998e-70 < (/.f64 z t) < 9.99999999999999965e-106

    1. Initial program 96.7%

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

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

    if 9.99999999999999965e-106 < (/.f64 z t) < 4.9999999999999996e22

    1. Initial program 99.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
    6. Taylor expanded in y around inf 43.0%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    8. Simplified61.2%

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    9. Step-by-step derivation
      1. clear-num61.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{t}{z}}{y}}} \]
      2. associate-/r/61.2%

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

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

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

    if 5.0000000000000001e215 < (/.f64 z t) < 1.0000000000000001e272

    1. Initial program 99.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+224}:\\ \;\;\;\;z \cdot \frac{-x}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq -5 \cdot 10^{-70}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;\frac{z}{t} \leq 10^{-105}:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+22}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+215} \lor \neg \left(\frac{z}{t} \leq 10^{+272}\right):\\ \;\;\;\;z \cdot \frac{-x}{t}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \end{array} \]

Alternative 3: 61.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{-x}{t}\\ \mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+224}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\frac{z}{t} \leq -5 \cdot 10^{-70}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;\frac{z}{t} \leq 10^{-105}:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+22}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+215}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\frac{z}{t} \leq 10^{+272}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{-z}{\frac{t}{x}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (/ (- x) t))))
   (if (<= (/ z t) -2e+224)
     t_1
     (if (<= (/ z t) -5e-70)
       (/ y (/ t z))
       (if (<= (/ z t) 1e-105)
         x
         (if (<= (/ z t) 5e+22)
           (* y (/ z t))
           (if (<= (/ z t) 5e+215)
             t_1
             (if (<= (/ z t) 1e+272) (* z (/ y t)) (/ (- z) (/ t x))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (-x / t);
	double tmp;
	if ((z / t) <= -2e+224) {
		tmp = t_1;
	} else if ((z / t) <= -5e-70) {
		tmp = y / (t / z);
	} else if ((z / t) <= 1e-105) {
		tmp = x;
	} else if ((z / t) <= 5e+22) {
		tmp = y * (z / t);
	} else if ((z / t) <= 5e+215) {
		tmp = t_1;
	} else if ((z / t) <= 1e+272) {
		tmp = z * (y / t);
	} else {
		tmp = -z / (t / 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) :: t_1
    real(8) :: tmp
    t_1 = z * (-x / t)
    if ((z / t) <= (-2d+224)) then
        tmp = t_1
    else if ((z / t) <= (-5d-70)) then
        tmp = y / (t / z)
    else if ((z / t) <= 1d-105) then
        tmp = x
    else if ((z / t) <= 5d+22) then
        tmp = y * (z / t)
    else if ((z / t) <= 5d+215) then
        tmp = t_1
    else if ((z / t) <= 1d+272) then
        tmp = z * (y / t)
    else
        tmp = -z / (t / x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * (-x / t);
	double tmp;
	if ((z / t) <= -2e+224) {
		tmp = t_1;
	} else if ((z / t) <= -5e-70) {
		tmp = y / (t / z);
	} else if ((z / t) <= 1e-105) {
		tmp = x;
	} else if ((z / t) <= 5e+22) {
		tmp = y * (z / t);
	} else if ((z / t) <= 5e+215) {
		tmp = t_1;
	} else if ((z / t) <= 1e+272) {
		tmp = z * (y / t);
	} else {
		tmp = -z / (t / x);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (-x / t)
	tmp = 0
	if (z / t) <= -2e+224:
		tmp = t_1
	elif (z / t) <= -5e-70:
		tmp = y / (t / z)
	elif (z / t) <= 1e-105:
		tmp = x
	elif (z / t) <= 5e+22:
		tmp = y * (z / t)
	elif (z / t) <= 5e+215:
		tmp = t_1
	elif (z / t) <= 1e+272:
		tmp = z * (y / t)
	else:
		tmp = -z / (t / x)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(Float64(-x) / t))
	tmp = 0.0
	if (Float64(z / t) <= -2e+224)
		tmp = t_1;
	elseif (Float64(z / t) <= -5e-70)
		tmp = Float64(y / Float64(t / z));
	elseif (Float64(z / t) <= 1e-105)
		tmp = x;
	elseif (Float64(z / t) <= 5e+22)
		tmp = Float64(y * Float64(z / t));
	elseif (Float64(z / t) <= 5e+215)
		tmp = t_1;
	elseif (Float64(z / t) <= 1e+272)
		tmp = Float64(z * Float64(y / t));
	else
		tmp = Float64(Float64(-z) / Float64(t / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * (-x / t);
	tmp = 0.0;
	if ((z / t) <= -2e+224)
		tmp = t_1;
	elseif ((z / t) <= -5e-70)
		tmp = y / (t / z);
	elseif ((z / t) <= 1e-105)
		tmp = x;
	elseif ((z / t) <= 5e+22)
		tmp = y * (z / t);
	elseif ((z / t) <= 5e+215)
		tmp = t_1;
	elseif ((z / t) <= 1e+272)
		tmp = z * (y / t);
	else
		tmp = -z / (t / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[((-x) / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z / t), $MachinePrecision], -2e+224], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], -5e-70], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 1e-105], x, If[LessEqual[N[(z / t), $MachinePrecision], 5e+22], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 5e+215], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], 1e+272], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], N[((-z) / N[(t / x), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \frac{-x}{t}\\
\mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+224}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;\frac{z}{t} \leq 10^{-105}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+215}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if (/.f64 z t) < -1.99999999999999994e224 or 4.9999999999999996e22 < (/.f64 z t) < 5.0000000000000001e215

    1. Initial program 96.6%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x}{t}\right)} \cdot z \]
      2. distribute-neg-frac72.8%

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

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

    if -1.99999999999999994e224 < (/.f64 z t) < -4.9999999999999998e-70

    1. Initial program 99.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
    6. Taylor expanded in y around inf 51.4%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    8. Simplified60.8%

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

    if -4.9999999999999998e-70 < (/.f64 z t) < 9.99999999999999965e-106

    1. Initial program 96.7%

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

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

    if 9.99999999999999965e-106 < (/.f64 z t) < 4.9999999999999996e22

    1. Initial program 99.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
    6. Taylor expanded in y around inf 43.0%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    8. Simplified61.2%

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    9. Step-by-step derivation
      1. clear-num61.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{t}{z}}{y}}} \]
      2. associate-/r/61.2%

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

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

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

    if 5.0000000000000001e215 < (/.f64 z t) < 1.0000000000000001e272

    1. Initial program 99.7%

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

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

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

    if 1.0000000000000001e272 < (/.f64 z t)

    1. Initial program 82.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
    6. Taylor expanded in y around 0 62.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot x}{t}} \]
    7. Step-by-step derivation
      1. mul-1-neg62.6%

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

        \[\leadsto -\color{blue}{\frac{z}{\frac{t}{x}}} \]
      3. distribute-neg-frac62.6%

        \[\leadsto \color{blue}{\frac{-z}{\frac{t}{x}}} \]
    8. Simplified62.6%

      \[\leadsto \color{blue}{\frac{-z}{\frac{t}{x}}} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification73.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+224}:\\ \;\;\;\;z \cdot \frac{-x}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq -5 \cdot 10^{-70}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;\frac{z}{t} \leq 10^{-105}:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+22}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+215}:\\ \;\;\;\;z \cdot \frac{-x}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 10^{+272}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{-z}{\frac{t}{x}}\\ \end{array} \]

Alternative 4: 61.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+224}:\\ \;\;\;\;\frac{x \cdot \left(-z\right)}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq -5 \cdot 10^{-70}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;\frac{z}{t} \leq 10^{-105}:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+22}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+215}:\\ \;\;\;\;z \cdot \frac{-x}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 10^{+272}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{-z}{\frac{t}{x}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ z t) -2e+224)
   (/ (* x (- z)) t)
   (if (<= (/ z t) -5e-70)
     (/ y (/ t z))
     (if (<= (/ z t) 1e-105)
       x
       (if (<= (/ z t) 5e+22)
         (* y (/ z t))
         (if (<= (/ z t) 5e+215)
           (* z (/ (- x) t))
           (if (<= (/ z t) 1e+272) (* z (/ y t)) (/ (- z) (/ t x)))))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -2e+224) {
		tmp = (x * -z) / t;
	} else if ((z / t) <= -5e-70) {
		tmp = y / (t / z);
	} else if ((z / t) <= 1e-105) {
		tmp = x;
	} else if ((z / t) <= 5e+22) {
		tmp = y * (z / t);
	} else if ((z / t) <= 5e+215) {
		tmp = z * (-x / t);
	} else if ((z / t) <= 1e+272) {
		tmp = z * (y / t);
	} else {
		tmp = -z / (t / 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) <= (-2d+224)) then
        tmp = (x * -z) / t
    else if ((z / t) <= (-5d-70)) then
        tmp = y / (t / z)
    else if ((z / t) <= 1d-105) then
        tmp = x
    else if ((z / t) <= 5d+22) then
        tmp = y * (z / t)
    else if ((z / t) <= 5d+215) then
        tmp = z * (-x / t)
    else if ((z / t) <= 1d+272) then
        tmp = z * (y / t)
    else
        tmp = -z / (t / x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -2e+224) {
		tmp = (x * -z) / t;
	} else if ((z / t) <= -5e-70) {
		tmp = y / (t / z);
	} else if ((z / t) <= 1e-105) {
		tmp = x;
	} else if ((z / t) <= 5e+22) {
		tmp = y * (z / t);
	} else if ((z / t) <= 5e+215) {
		tmp = z * (-x / t);
	} else if ((z / t) <= 1e+272) {
		tmp = z * (y / t);
	} else {
		tmp = -z / (t / x);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z / t) <= -2e+224:
		tmp = (x * -z) / t
	elif (z / t) <= -5e-70:
		tmp = y / (t / z)
	elif (z / t) <= 1e-105:
		tmp = x
	elif (z / t) <= 5e+22:
		tmp = y * (z / t)
	elif (z / t) <= 5e+215:
		tmp = z * (-x / t)
	elif (z / t) <= 1e+272:
		tmp = z * (y / t)
	else:
		tmp = -z / (t / x)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z / t) <= -2e+224)
		tmp = Float64(Float64(x * Float64(-z)) / t);
	elseif (Float64(z / t) <= -5e-70)
		tmp = Float64(y / Float64(t / z));
	elseif (Float64(z / t) <= 1e-105)
		tmp = x;
	elseif (Float64(z / t) <= 5e+22)
		tmp = Float64(y * Float64(z / t));
	elseif (Float64(z / t) <= 5e+215)
		tmp = Float64(z * Float64(Float64(-x) / t));
	elseif (Float64(z / t) <= 1e+272)
		tmp = Float64(z * Float64(y / t));
	else
		tmp = Float64(Float64(-z) / Float64(t / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z / t) <= -2e+224)
		tmp = (x * -z) / t;
	elseif ((z / t) <= -5e-70)
		tmp = y / (t / z);
	elseif ((z / t) <= 1e-105)
		tmp = x;
	elseif ((z / t) <= 5e+22)
		tmp = y * (z / t);
	elseif ((z / t) <= 5e+215)
		tmp = z * (-x / t);
	elseif ((z / t) <= 1e+272)
		tmp = z * (y / t);
	else
		tmp = -z / (t / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z / t), $MachinePrecision], -2e+224], N[(N[(x * (-z)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], -5e-70], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 1e-105], x, If[LessEqual[N[(z / t), $MachinePrecision], 5e+22], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 5e+215], N[(z * N[((-x) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 1e+272], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], N[((-z) / N[(t / x), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;\frac{z}{t} \leq 10^{-105}:\\
\;\;\;\;x\\

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

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

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

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


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

    1. Initial program 93.2%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
    6. Taylor expanded in y around 0 71.8%

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

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

        \[\leadsto \frac{\color{blue}{-z \cdot x}}{t} \]
      3. distribute-rgt-neg-out71.8%

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

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

    if -1.99999999999999994e224 < (/.f64 z t) < -4.9999999999999998e-70

    1. Initial program 99.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
    6. Taylor expanded in y around inf 51.4%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    8. Simplified60.8%

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

    if -4.9999999999999998e-70 < (/.f64 z t) < 9.99999999999999965e-106

    1. Initial program 96.7%

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

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

    if 9.99999999999999965e-106 < (/.f64 z t) < 4.9999999999999996e22

    1. Initial program 99.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
    6. Taylor expanded in y around inf 43.0%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    8. Simplified61.2%

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    9. Step-by-step derivation
      1. clear-num61.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{t}{z}}{y}}} \]
      2. associate-/r/61.2%

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

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

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

    if 4.9999999999999996e22 < (/.f64 z t) < 5.0000000000000001e215

    1. Initial program 99.6%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x}{t}\right)} \cdot z \]
      2. distribute-neg-frac73.8%

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

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

    if 5.0000000000000001e215 < (/.f64 z t) < 1.0000000000000001e272

    1. Initial program 99.7%

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

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

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

    if 1.0000000000000001e272 < (/.f64 z t)

    1. Initial program 82.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
    6. Taylor expanded in y around 0 62.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot x}{t}} \]
    7. Step-by-step derivation
      1. mul-1-neg62.6%

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

        \[\leadsto -\color{blue}{\frac{z}{\frac{t}{x}}} \]
      3. distribute-neg-frac62.6%

        \[\leadsto \color{blue}{\frac{-z}{\frac{t}{x}}} \]
    8. Simplified62.6%

      \[\leadsto \color{blue}{\frac{-z}{\frac{t}{x}}} \]
  3. Recombined 7 regimes into one program.
  4. Final simplification73.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+224}:\\ \;\;\;\;\frac{x \cdot \left(-z\right)}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq -5 \cdot 10^{-70}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;\frac{z}{t} \leq 10^{-105}:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+22}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+215}:\\ \;\;\;\;z \cdot \frac{-x}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 10^{+272}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{-z}{\frac{t}{x}}\\ \end{array} \]

Alternative 5: 98.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{if}\;t_1 \leq 4 \cdot 10^{+306}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(y - x\right) \cdot z}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (* (- y x) (/ z t)))))
   (if (<= t_1 4e+306) t_1 (/ (* (- y x) z) t))))
double code(double x, double y, double z, double t) {
	double t_1 = x + ((y - x) * (z / t));
	double tmp;
	if (t_1 <= 4e+306) {
		tmp = t_1;
	} else {
		tmp = ((y - x) * 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) :: t_1
    real(8) :: tmp
    t_1 = x + ((y - x) * (z / t))
    if (t_1 <= 4d+306) then
        tmp = t_1
    else
        tmp = ((y - x) * z) / t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x + ((y - x) * (z / t));
	double tmp;
	if (t_1 <= 4e+306) {
		tmp = t_1;
	} else {
		tmp = ((y - x) * z) / t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + ((y - x) * (z / t))
	tmp = 0
	if t_1 <= 4e+306:
		tmp = t_1
	else:
		tmp = ((y - x) * z) / t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(Float64(y - x) * Float64(z / t)))
	tmp = 0.0
	if (t_1 <= 4e+306)
		tmp = t_1;
	else
		tmp = Float64(Float64(Float64(y - x) * z) / t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + ((y - x) * (z / t));
	tmp = 0.0;
	if (t_1 <= 4e+306)
		tmp = t_1;
	else
		tmp = ((y - x) * z) / t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 4e+306], t$95$1, N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (*.f64 (-.f64 y x) (/.f64 z t))) < 4.00000000000000007e306

    1. Initial program 98.1%

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

    if 4.00000000000000007e306 < (+.f64 x (*.f64 (-.f64 y x) (/.f64 z t)))

    1. Initial program 84.7%

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

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

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

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

Alternative 6: 83.4% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 z t) < -4.9999999999999998e-70 or 9.99999999999999965e-106 < (/.f64 z t)

    1. Initial program 95.9%

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

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

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

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

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{1}{\frac{t}{z}}} \]
      3. clear-num87.5%

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\frac{z}{t}} \]
    5. Applied egg-rr87.5%

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

    if -4.9999999999999998e-70 < (/.f64 z t) < 9.99999999999999965e-106

    1. Initial program 96.7%

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

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

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

Alternative 7: 83.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-70}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{-28}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ z t) -5e-70)
   (* (- y x) (/ z t))
   (if (<= (/ z t) 5e-28) x (* z (/ (- y x) t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -5e-70) {
		tmp = (y - x) * (z / t);
	} else if ((z / t) <= 5e-28) {
		tmp = x;
	} 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) <= (-5d-70)) then
        tmp = (y - x) * (z / t)
    else if ((z / t) <= 5d-28) then
        tmp = x
    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) <= -5e-70) {
		tmp = (y - x) * (z / t);
	} else if ((z / t) <= 5e-28) {
		tmp = x;
	} else {
		tmp = z * ((y - x) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z / t) <= -5e-70:
		tmp = (y - x) * (z / t)
	elif (z / t) <= 5e-28:
		tmp = x
	else:
		tmp = z * ((y - x) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z / t) <= -5e-70)
		tmp = Float64(Float64(y - x) * Float64(z / t));
	elseif (Float64(z / t) <= 5e-28)
		tmp = x;
	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) <= -5e-70)
		tmp = (y - x) * (z / t);
	elseif ((z / t) <= 5e-28)
		tmp = x;
	else
		tmp = z * ((y - x) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z / t), $MachinePrecision], -5e-70], N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 5e-28], x, N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 97.4%

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

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

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

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

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{1}{\frac{t}{z}}} \]
      3. clear-num91.5%

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\frac{z}{t}} \]
    5. Applied egg-rr91.5%

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

    if -4.9999999999999998e-70 < (/.f64 z t) < 5.0000000000000002e-28

    1. Initial program 97.2%

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

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

    if 5.0000000000000002e-28 < (/.f64 z t)

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

Alternative 8: 95.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 4 \cdot 10^{-17}:\\ \;\;\;\;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) -2.0)
   (* (- y x) (/ z t))
   (if (<= (/ z t) 4e-17) (+ x (* y (/ z t))) (* z (/ (- y x) t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -2.0) {
		tmp = (y - x) * (z / t);
	} else if ((z / t) <= 4e-17) {
		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) <= (-2.0d0)) then
        tmp = (y - x) * (z / t)
    else if ((z / t) <= 4d-17) 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) <= -2.0) {
		tmp = (y - x) * (z / t);
	} else if ((z / t) <= 4e-17) {
		tmp = x + (y * (z / t));
	} else {
		tmp = z * ((y - x) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z / t) <= -2.0:
		tmp = (y - x) * (z / t)
	elif (z / t) <= 4e-17:
		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) <= -2.0)
		tmp = Float64(Float64(y - x) * Float64(z / t));
	elseif (Float64(z / t) <= 4e-17)
		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) <= -2.0)
		tmp = (y - x) * (z / t);
	elseif ((z / t) <= 4e-17)
		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], -2.0], N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 4e-17], 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 -2:\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\

\mathbf{elif}\;\frac{z}{t} \leq 4 \cdot 10^{-17}:\\
\;\;\;\;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) < -2

    1. Initial program 97.0%

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      2. div-inv95.7%

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

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\frac{z}{t}} \]
    5. Applied egg-rr95.8%

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

    if -2 < (/.f64 z t) < 4.00000000000000029e-17

    1. Initial program 97.5%

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

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

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

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

    if 4.00000000000000029e-17 < (/.f64 z t)

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

Alternative 9: 94.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -1 \cdot 10^{-18}:\\ \;\;\;\;\frac{y - x}{\frac{t}{z}}\\ \mathbf{elif}\;\frac{z}{t} \leq 4 \cdot 10^{-17}:\\ \;\;\;\;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) -1e-18)
   (/ (- y x) (/ t z))
   (if (<= (/ z t) 4e-17) (+ x (* y (/ z t))) (* z (/ (- y x) t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -1e-18) {
		tmp = (y - x) / (t / z);
	} else if ((z / t) <= 4e-17) {
		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) <= (-1d-18)) then
        tmp = (y - x) / (t / z)
    else if ((z / t) <= 4d-17) 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) <= -1e-18) {
		tmp = (y - x) / (t / z);
	} else if ((z / t) <= 4e-17) {
		tmp = x + (y * (z / t));
	} else {
		tmp = z * ((y - x) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z / t) <= -1e-18:
		tmp = (y - x) / (t / z)
	elif (z / t) <= 4e-17:
		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) <= -1e-18)
		tmp = Float64(Float64(y - x) / Float64(t / z));
	elseif (Float64(z / t) <= 4e-17)
		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) <= -1e-18)
		tmp = (y - x) / (t / z);
	elseif ((z / t) <= 4e-17)
		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], -1e-18], N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 4e-17], 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 -1 \cdot 10^{-18}:\\
\;\;\;\;\frac{y - x}{\frac{t}{z}}\\

\mathbf{elif}\;\frac{z}{t} \leq 4 \cdot 10^{-17}:\\
\;\;\;\;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) < -1.0000000000000001e-18

    1. Initial program 97.0%

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
    4. Applied egg-rr95.9%

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

    if -1.0000000000000001e-18 < (/.f64 z t) < 4.00000000000000029e-17

    1. Initial program 97.5%

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

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

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

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

    if 4.00000000000000029e-17 < (/.f64 z t)

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

Alternative 10: 63.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-70}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{-48}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ z t) -5e-70)
   (* y (/ z t))
   (if (<= (/ z t) 5e-48) x (* z (/ y t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -5e-70) {
		tmp = y * (z / t);
	} else if ((z / t) <= 5e-48) {
		tmp = x;
	} else {
		tmp = z * (y / 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) <= (-5d-70)) then
        tmp = y * (z / t)
    else if ((z / t) <= 5d-48) then
        tmp = x
    else
        tmp = z * (y / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -5e-70) {
		tmp = y * (z / t);
	} else if ((z / t) <= 5e-48) {
		tmp = x;
	} else {
		tmp = z * (y / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z / t) <= -5e-70:
		tmp = y * (z / t)
	elif (z / t) <= 5e-48:
		tmp = x
	else:
		tmp = z * (y / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z / t) <= -5e-70)
		tmp = Float64(y * Float64(z / t));
	elseif (Float64(z / t) <= 5e-48)
		tmp = x;
	else
		tmp = Float64(z * Float64(y / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z / t) <= -5e-70)
		tmp = y * (z / t);
	elseif ((z / t) <= 5e-48)
		tmp = x;
	else
		tmp = z * (y / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z / t), $MachinePrecision], -5e-70], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 5e-48], x, N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 97.4%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
    6. Taylor expanded in y around inf 50.4%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    8. Simplified56.4%

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    9. Step-by-step derivation
      1. clear-num56.4%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{t}{z}}{y}}} \]
      2. associate-/r/56.3%

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

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

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

    if -4.9999999999999998e-70 < (/.f64 z t) < 4.9999999999999999e-48

    1. Initial program 97.1%

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

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

    if 4.9999999999999999e-48 < (/.f64 z t)

    1. Initial program 93.8%

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

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

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

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

Alternative 11: 62.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-70}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{-48}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ z t) -5e-70)
   (/ y (/ t z))
   (if (<= (/ z t) 5e-48) x (* z (/ y t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -5e-70) {
		tmp = y / (t / z);
	} else if ((z / t) <= 5e-48) {
		tmp = x;
	} else {
		tmp = z * (y / 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) <= (-5d-70)) then
        tmp = y / (t / z)
    else if ((z / t) <= 5d-48) then
        tmp = x
    else
        tmp = z * (y / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -5e-70) {
		tmp = y / (t / z);
	} else if ((z / t) <= 5e-48) {
		tmp = x;
	} else {
		tmp = z * (y / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z / t) <= -5e-70:
		tmp = y / (t / z)
	elif (z / t) <= 5e-48:
		tmp = x
	else:
		tmp = z * (y / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z / t) <= -5e-70)
		tmp = Float64(y / Float64(t / z));
	elseif (Float64(z / t) <= 5e-48)
		tmp = x;
	else
		tmp = Float64(z * Float64(y / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z / t) <= -5e-70)
		tmp = y / (t / z);
	elseif ((z / t) <= 5e-48)
		tmp = x;
	else
		tmp = z * (y / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z / t), $MachinePrecision], -5e-70], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 5e-48], x, N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 97.4%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
    6. Taylor expanded in y around inf 50.4%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    8. Simplified56.4%

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

    if -4.9999999999999998e-70 < (/.f64 z t) < 4.9999999999999999e-48

    1. Initial program 97.1%

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

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

    if 4.9999999999999999e-48 < (/.f64 z t)

    1. Initial program 93.8%

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

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

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

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

Alternative 12: 63.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-70}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{-48}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{\frac{t}{y}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ z t) -5e-70)
   (/ y (/ t z))
   (if (<= (/ z t) 5e-48) x (/ z (/ t y)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -5e-70) {
		tmp = y / (t / z);
	} else if ((z / t) <= 5e-48) {
		tmp = x;
	} else {
		tmp = z / (t / y);
	}
	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-70)) then
        tmp = y / (t / z)
    else if ((z / t) <= 5d-48) then
        tmp = x
    else
        tmp = z / (t / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -5e-70) {
		tmp = y / (t / z);
	} else if ((z / t) <= 5e-48) {
		tmp = x;
	} else {
		tmp = z / (t / y);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z / t) <= -5e-70:
		tmp = y / (t / z)
	elif (z / t) <= 5e-48:
		tmp = x
	else:
		tmp = z / (t / y)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z / t) <= -5e-70)
		tmp = Float64(y / Float64(t / z));
	elseif (Float64(z / t) <= 5e-48)
		tmp = x;
	else
		tmp = Float64(z / Float64(t / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z / t) <= -5e-70)
		tmp = y / (t / z);
	elseif ((z / t) <= 5e-48)
		tmp = x;
	else
		tmp = z / (t / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z / t), $MachinePrecision], -5e-70], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 5e-48], x, N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 97.4%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
    6. Taylor expanded in y around inf 50.4%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    8. Simplified56.4%

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

    if -4.9999999999999998e-70 < (/.f64 z t) < 4.9999999999999999e-48

    1. Initial program 97.1%

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

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

    if 4.9999999999999999e-48 < (/.f64 z t)

    1. Initial program 93.8%

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

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

      \[\leadsto \color{blue}{\frac{y}{t}} \cdot z \]
    4. Step-by-step derivation
      1. *-commutative51.2%

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

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

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

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

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

Alternative 13: 52.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{-107} \lor \neg \left(z \leq 1.1 \cdot 10^{-57}\right):\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -1.5e-107) (not (<= z 1.1e-57))) (* z (/ y t)) x))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.5e-107) || !(z <= 1.1e-57)) {
		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.5d-107)) .or. (.not. (z <= 1.1d-57))) 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.5e-107) || !(z <= 1.1e-57)) {
		tmp = z * (y / t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -1.5e-107) or not (z <= 1.1e-57):
		tmp = z * (y / t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1.5e-107) || !(z <= 1.1e-57))
		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.5e-107) || ~((z <= 1.1e-57)))
		tmp = z * (y / t);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.5e-107], N[Not[LessEqual[z, 1.1e-57]], $MachinePrecision]], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-107} \lor \neg \left(z \leq 1.1 \cdot 10^{-57}\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.4999999999999999e-107 or 1.09999999999999999e-57 < z

    1. Initial program 95.7%

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

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

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

    if -1.4999999999999999e-107 < z < 1.09999999999999999e-57

    1. Initial program 97.0%

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

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

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

Alternative 14: 38.6% 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 96.2%

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification36.5%

    \[\leadsto x \]

Developer target: 97.3% 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 2023279 
(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))))