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

Percentage Accurate: 97.7% → 97.7%
Time: 5.6s
Alternatives: 9
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 9 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.7% 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: 97.7% 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.8%

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

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

Alternative 2: 64.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z}{t}\\ t_2 := \frac{-z}{\frac{t}{x}}\\ \mathbf{if}\;\frac{z}{t} \leq -1 \cdot 10^{+119}:\\ \;\;\;\;x \cdot \frac{-z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq -5 \cdot 10^{+76}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\frac{z}{t} \leq -1 \cdot 10^{+46}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;\frac{z}{t} \leq -5 \cdot 10^{-43}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\frac{z}{t} \leq 2 \cdot 10^{-12}:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+140}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \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) -1e+119)
     (* x (/ (- z) t))
     (if (<= (/ z t) -5e+76)
       t_1
       (if (<= (/ z t) -1e+46)
         t_2
         (if (<= (/ z t) -5e-43)
           t_1
           (if (<= (/ z t) 2e-12)
             x
             (if (<= (/ z t) 5e+140) (* z (/ y t)) t_2))))))))
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) <= -1e+119) {
		tmp = x * (-z / t);
	} else if ((z / t) <= -5e+76) {
		tmp = t_1;
	} else if ((z / t) <= -1e+46) {
		tmp = t_2;
	} else if ((z / t) <= -5e-43) {
		tmp = t_1;
	} else if ((z / t) <= 2e-12) {
		tmp = x;
	} else if ((z / t) <= 5e+140) {
		tmp = z * (y / 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 * (z / t)
    t_2 = -z / (t / x)
    if ((z / t) <= (-1d+119)) then
        tmp = x * (-z / t)
    else if ((z / t) <= (-5d+76)) then
        tmp = t_1
    else if ((z / t) <= (-1d+46)) then
        tmp = t_2
    else if ((z / t) <= (-5d-43)) then
        tmp = t_1
    else if ((z / t) <= 2d-12) then
        tmp = x
    else if ((z / t) <= 5d+140) then
        tmp = z * (y / 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 * (z / t);
	double t_2 = -z / (t / x);
	double tmp;
	if ((z / t) <= -1e+119) {
		tmp = x * (-z / t);
	} else if ((z / t) <= -5e+76) {
		tmp = t_1;
	} else if ((z / t) <= -1e+46) {
		tmp = t_2;
	} else if ((z / t) <= -5e-43) {
		tmp = t_1;
	} else if ((z / t) <= 2e-12) {
		tmp = x;
	} else if ((z / t) <= 5e+140) {
		tmp = z * (y / t);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (z / t)
	t_2 = -z / (t / x)
	tmp = 0
	if (z / t) <= -1e+119:
		tmp = x * (-z / t)
	elif (z / t) <= -5e+76:
		tmp = t_1
	elif (z / t) <= -1e+46:
		tmp = t_2
	elif (z / t) <= -5e-43:
		tmp = t_1
	elif (z / t) <= 2e-12:
		tmp = x
	elif (z / t) <= 5e+140:
		tmp = z * (y / t)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(z / t))
	t_2 = Float64(Float64(-z) / Float64(t / x))
	tmp = 0.0
	if (Float64(z / t) <= -1e+119)
		tmp = Float64(x * Float64(Float64(-z) / t));
	elseif (Float64(z / t) <= -5e+76)
		tmp = t_1;
	elseif (Float64(z / t) <= -1e+46)
		tmp = t_2;
	elseif (Float64(z / t) <= -5e-43)
		tmp = t_1;
	elseif (Float64(z / t) <= 2e-12)
		tmp = x;
	elseif (Float64(z / t) <= 5e+140)
		tmp = Float64(z * Float64(y / t));
	else
		tmp = t_2;
	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) <= -1e+119)
		tmp = x * (-z / t);
	elseif ((z / t) <= -5e+76)
		tmp = t_1;
	elseif ((z / t) <= -1e+46)
		tmp = t_2;
	elseif ((z / t) <= -5e-43)
		tmp = t_1;
	elseif ((z / t) <= 2e-12)
		tmp = x;
	elseif ((z / t) <= 5e+140)
		tmp = z * (y / t);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-z) / N[(t / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z / t), $MachinePrecision], -1e+119], N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], -5e+76], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], -1e+46], t$95$2, If[LessEqual[N[(z / t), $MachinePrecision], -5e-43], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], 2e-12], x, If[LessEqual[N[(z / t), $MachinePrecision], 5e+140], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{t}\\
t_2 := \frac{-z}{\frac{t}{x}}\\
\mathbf{if}\;\frac{z}{t} \leq -1 \cdot 10^{+119}:\\
\;\;\;\;x \cdot \frac{-z}{t}\\

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

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

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

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

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

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


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

    1. Initial program 92.0%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \frac{z}{t}} \]
      5. *-rgt-identity67.3%

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{z}{t} \cdot x\right)} \]
      2. associate-*r*67.3%

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

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

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

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

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

    if -9.99999999999999944e118 < (/.f64 z t) < -4.99999999999999991e76 or -9.9999999999999999e45 < (/.f64 z t) < -5.00000000000000019e-43

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + \frac{y \cdot z}{t}\right) - \color{blue}{\frac{x}{\frac{t}{z}}} \]
      14. associate-+r-86.5%

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

        \[\leadsto x + \left(\color{blue}{\frac{y}{\frac{t}{z}}} - \frac{x}{\frac{t}{z}}\right) \]
      16. div-sub99.8%

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      17. associate-/l*90.1%

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y - x}{t}, x\right)} \]
    5. Taylor expanded in y around inf 56.7%

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
    7. Simplified66.5%

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

    if -4.99999999999999991e76 < (/.f64 z t) < -9.9999999999999999e45 or 5.00000000000000008e140 < (/.f64 z t)

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + \frac{y \cdot z}{t}\right) - \color{blue}{\frac{x}{\frac{t}{z}}} \]
      14. associate-+r-87.3%

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

        \[\leadsto x + \left(\color{blue}{\frac{y}{\frac{t}{z}}} - \frac{x}{\frac{t}{z}}\right) \]
      16. div-sub99.0%

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      17. associate-/l*96.0%

        \[\leadsto x + \color{blue}{\frac{\left(y - x\right) \cdot z}{t}} \]
      18. *-commutative96.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y - x}{t}, x\right)} \]
    5. Taylor expanded in z around inf 98.0%

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

        \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
      2. *-rgt-identity98.0%

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

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

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

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\frac{1 \cdot z}{t}} \]
      6. *-lft-identity97.9%

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

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

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

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

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

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

    if -5.00000000000000019e-43 < (/.f64 z t) < 1.99999999999999996e-12

    1. Initial program 98.6%

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

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

    if 1.99999999999999996e-12 < (/.f64 z t) < 5.00000000000000008e140

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{y \cdot z}{t} + x\right) + \color{blue}{\left(-\frac{z \cdot x}{t}\right)} \]
      10. unsub-neg78.6%

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

        \[\leadsto \color{blue}{\left(x + \frac{y \cdot z}{t}\right)} - \frac{z \cdot x}{t} \]
      12. *-commutative78.6%

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

        \[\leadsto \left(x + \frac{y \cdot z}{t}\right) - \color{blue}{\frac{x}{\frac{t}{z}}} \]
      14. associate-+r-87.1%

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

        \[\leadsto x + \left(\color{blue}{\frac{y}{\frac{t}{z}}} - \frac{x}{\frac{t}{z}}\right) \]
      16. div-sub99.5%

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      17. associate-/l*87.3%

        \[\leadsto x + \color{blue}{\frac{\left(y - x\right) \cdot z}{t}} \]
      18. *-commutative87.3%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y - x}{t}, x\right)} \]
    5. Taylor expanded in y around inf 66.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -1 \cdot 10^{+119}:\\ \;\;\;\;x \cdot \frac{-z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq -5 \cdot 10^{+76}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq -1 \cdot 10^{+46}:\\ \;\;\;\;\frac{-z}{\frac{t}{x}}\\ \mathbf{elif}\;\frac{z}{t} \leq -5 \cdot 10^{-43}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 2 \cdot 10^{-12}:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+140}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{-z}{\frac{t}{x}}\\ \end{array} \]

Alternative 3: 64.3% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 z t) < -5.00000000000000019e-43

    1. Initial program 95.9%

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

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

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

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

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

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

        \[\leadsto \frac{y \cdot z}{t} + \left(x - \color{blue}{\frac{z \cdot x}{t}}\right) \]
      6. unsub-neg82.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x + \frac{y \cdot z}{t}\right)} - \frac{z \cdot x}{t} \]
      12. *-commutative82.0%

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

        \[\leadsto \left(x + \frac{y \cdot z}{t}\right) - \color{blue}{\frac{x}{\frac{t}{z}}} \]
      14. associate-+r-83.0%

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

        \[\leadsto x + \left(\color{blue}{\frac{y}{\frac{t}{z}}} - \frac{x}{\frac{t}{z}}\right) \]
      16. div-sub95.8%

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      17. associate-/l*90.5%

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y - x}{t}, x\right)} \]
    5. Taylor expanded in y around inf 50.3%

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
    7. Simplified53.1%

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

    if -5.00000000000000019e-43 < (/.f64 z t) < 1.99999999999999996e-12

    1. Initial program 98.6%

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

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

    if 1.99999999999999996e-12 < (/.f64 z t) < 5.00000000000000008e140

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{y \cdot z}{t} + x\right) + \color{blue}{\left(-\frac{z \cdot x}{t}\right)} \]
      10. unsub-neg78.6%

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

        \[\leadsto \color{blue}{\left(x + \frac{y \cdot z}{t}\right)} - \frac{z \cdot x}{t} \]
      12. *-commutative78.6%

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

        \[\leadsto \left(x + \frac{y \cdot z}{t}\right) - \color{blue}{\frac{x}{\frac{t}{z}}} \]
      14. associate-+r-87.1%

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

        \[\leadsto x + \left(\color{blue}{\frac{y}{\frac{t}{z}}} - \frac{x}{\frac{t}{z}}\right) \]
      16. div-sub99.5%

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      17. associate-/l*87.3%

        \[\leadsto x + \color{blue}{\frac{\left(y - x\right) \cdot z}{t}} \]
      18. *-commutative87.3%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y - x}{t}, x\right)} \]
    5. Taylor expanded in y around inf 66.8%

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

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

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

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

    if 5.00000000000000008e140 < (/.f64 z t)

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + \frac{y \cdot z}{t}\right) - \color{blue}{\frac{x}{\frac{t}{z}}} \]
      14. associate-+r-85.6%

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

        \[\leadsto x + \left(\color{blue}{\frac{y}{\frac{t}{z}}} - \frac{x}{\frac{t}{z}}\right) \]
      16. div-sub98.9%

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      17. associate-/l*97.7%

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y - x}{t}, x\right)} \]
    5. Taylor expanded in z around inf 97.8%

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

        \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
      2. *-rgt-identity97.8%

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

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

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

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\frac{1 \cdot z}{t}} \]
      6. *-lft-identity97.6%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot x}{t}} \]
    9. Step-by-step derivation
      1. mul-1-neg65.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-43}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 2 \cdot 10^{-12}:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+140}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{-z}{\frac{t}{x}}\\ \end{array} \]

Alternative 4: 94.8% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + \frac{y \cdot z}{t}\right) - \color{blue}{\frac{x}{\frac{t}{z}}} \]
      14. associate-+r-83.3%

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

        \[\leadsto x + \left(\color{blue}{\frac{y}{\frac{t}{z}}} - \frac{x}{\frac{t}{z}}\right) \]
      16. div-sub95.1%

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      17. associate-/l*92.1%

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y - x}{t}, x\right)} \]
    5. Taylor expanded in z around inf 87.5%

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

        \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
      2. *-rgt-identity92.6%

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

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

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

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

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

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

    if -1e7 < (/.f64 z t) < 1.99999999999999996e-12

    1. Initial program 98.7%

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

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

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

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

    if 1.99999999999999996e-12 < (/.f64 z t)

    1. Initial program 98.4%

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

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

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

Alternative 5: 85.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-43} \lor \neg \left(\frac{z}{t} \leq 2 \cdot 10^{-12}\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-43) (not (<= (/ z t) 2e-12))) (* (- y x) (/ z t)) x))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((z / t) <= -5e-43) || !((z / t) <= 2e-12)) {
		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-43)) .or. (.not. ((z / t) <= 2d-12))) 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-43) || !((z / t) <= 2e-12)) {
		tmp = (y - x) * (z / t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((z / t) <= -5e-43) or not ((z / t) <= 2e-12):
		tmp = (y - x) * (z / t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((Float64(z / t) <= -5e-43) || !(Float64(z / t) <= 2e-12))
		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-43) || ~(((z / t) <= 2e-12)))
		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-43], N[Not[LessEqual[N[(z / t), $MachinePrecision], 2e-12]], $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^{-43} \lor \neg \left(\frac{z}{t} \leq 2 \cdot 10^{-12}\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) < -5.00000000000000019e-43 or 1.99999999999999996e-12 < (/.f64 z t)

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + \frac{y \cdot z}{t}\right) - \color{blue}{\frac{x}{\frac{t}{z}}} \]
      14. associate-+r-84.5%

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

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

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      17. associate-/l*92.2%

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y - x}{t}, x\right)} \]
    5. Taylor expanded in z around inf 90.5%

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

        \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
      2. *-rgt-identity92.8%

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

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

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

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\frac{1 \cdot z}{t}} \]
      6. *-lft-identity93.1%

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

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

    if -5.00000000000000019e-43 < (/.f64 z t) < 1.99999999999999996e-12

    1. Initial program 98.6%

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

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

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

Alternative 6: 96.4% accurate, 0.6× speedup?

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

    1. Initial program 96.9%

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

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

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

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

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

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

        \[\leadsto \frac{y \cdot z}{t} + \left(x - \color{blue}{\frac{z \cdot x}{t}}\right) \]
      6. unsub-neg83.5%

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

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

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

        \[\leadsto \left(\frac{y \cdot z}{t} + x\right) + \color{blue}{\left(-\frac{z \cdot x}{t}\right)} \]
      10. unsub-neg83.5%

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

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

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

        \[\leadsto \left(x + \frac{y \cdot z}{t}\right) - \color{blue}{\frac{x}{\frac{t}{z}}} \]
      14. associate-+r-84.8%

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

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

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      17. associate-/l*93.1%

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y - x}{t}, x\right)} \]
    5. Taylor expanded in z around inf 92.8%

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

        \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
      2. *-rgt-identity95.2%

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

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

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

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\frac{1 \cdot z}{t}} \]
      6. *-lft-identity95.5%

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

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

    if -1e7 < (/.f64 z t) < 1.99999999999999996e-12

    1. Initial program 98.7%

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

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

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

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

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

Alternative 7: 65.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-43} \lor \neg \left(\frac{z}{t} \leq 2 \cdot 10^{-12}\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-43) (not (<= (/ z t) 2e-12))) (* y (/ z t)) x))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((z / t) <= -5e-43) || !((z / t) <= 2e-12)) {
		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-43)) .or. (.not. ((z / t) <= 2d-12))) 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-43) || !((z / t) <= 2e-12)) {
		tmp = y * (z / t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((z / t) <= -5e-43) or not ((z / t) <= 2e-12):
		tmp = y * (z / t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((Float64(z / t) <= -5e-43) || !(Float64(z / t) <= 2e-12))
		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-43) || ~(((z / t) <= 2e-12)))
		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-43], N[Not[LessEqual[N[(z / t), $MachinePrecision], 2e-12]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-43} \lor \neg \left(\frac{z}{t} \leq 2 \cdot 10^{-12}\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.00000000000000019e-43 or 1.99999999999999996e-12 < (/.f64 z t)

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + \frac{y \cdot z}{t}\right) - \color{blue}{\frac{x}{\frac{t}{z}}} \]
      14. associate-+r-84.5%

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

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

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      17. associate-/l*92.2%

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y - x}{t}, x\right)} \]
    5. Taylor expanded in y around inf 52.1%

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
    7. Simplified56.2%

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

    if -5.00000000000000019e-43 < (/.f64 z t) < 1.99999999999999996e-12

    1. Initial program 98.6%

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

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

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

Alternative 8: 65.0% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 95.9%

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

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

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

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

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

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

        \[\leadsto \frac{y \cdot z}{t} + \left(x - \color{blue}{\frac{z \cdot x}{t}}\right) \]
      6. unsub-neg82.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x + \frac{y \cdot z}{t}\right)} - \frac{z \cdot x}{t} \]
      12. *-commutative82.0%

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

        \[\leadsto \left(x + \frac{y \cdot z}{t}\right) - \color{blue}{\frac{x}{\frac{t}{z}}} \]
      14. associate-+r-83.0%

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

        \[\leadsto x + \left(\color{blue}{\frac{y}{\frac{t}{z}}} - \frac{x}{\frac{t}{z}}\right) \]
      16. div-sub95.8%

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      17. associate-/l*90.5%

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y - x}{t}, x\right)} \]
    5. Taylor expanded in y around inf 50.3%

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
    7. Simplified53.1%

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

    if -5.00000000000000019e-43 < (/.f64 z t) < 1.99999999999999996e-12

    1. Initial program 98.6%

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

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

    if 1.99999999999999996e-12 < (/.f64 z t)

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + \frac{y \cdot z}{t}\right) - \color{blue}{\frac{x}{\frac{t}{z}}} \]
      14. associate-+r-86.1%

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

        \[\leadsto x + \left(\color{blue}{\frac{y}{\frac{t}{z}}} - \frac{x}{\frac{t}{z}}\right) \]
      16. div-sub99.1%

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      17. associate-/l*94.0%

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y - x}{t}, x\right)} \]
    5. Taylor expanded in y around inf 54.1%

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
    7. Simplified59.5%

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

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

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

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

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

Alternative 9: 38.7% 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.8%

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification40.8%

    \[\leadsto x \]

Developer target: 97.6% 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 2023187 
(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))))