Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B

Percentage Accurate: 98.3% → 98.6%
Time: 7.7s
Alternatives: 12
Speedup: 0.6×

Specification

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

\\
x + y \cdot \frac{z - t}{a - t}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 98.3% accurate, 1.0× speedup?

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

\\
x + y \cdot \frac{z - t}{a - t}
\end{array}

Alternative 1: 98.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{a - t}\\ \mathbf{if}\;t_1 \leq 5 \cdot 10^{+54}:\\ \;\;\;\;x + t_1 \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t - z, \frac{y}{t - a}, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- z t) (- a t))))
   (if (<= t_1 5e+54) (+ x (* t_1 y)) (fma (- t z) (/ y (- t a)) x))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (z - t) / (a - t);
	double tmp;
	if (t_1 <= 5e+54) {
		tmp = x + (t_1 * y);
	} else {
		tmp = fma((t - z), (y / (t - a)), x);
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(Float64(z - t) / Float64(a - t))
	tmp = 0.0
	if (t_1 <= 5e+54)
		tmp = Float64(x + Float64(t_1 * y));
	else
		tmp = fma(Float64(t - z), Float64(y / Float64(t - a)), x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+54], N[(x + N[(t$95$1 * y), $MachinePrecision]), $MachinePrecision], N[(N[(t - z), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - z, \frac{y}{t - a}, x\right)\\


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

    1. Initial program 99.4%

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

    if 5.00000000000000005e54 < (/.f64 (-.f64 z t) (-.f64 a t))

    1. Initial program 83.7%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative83.7%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t} + x} \]
      2. *-commutative83.7%

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/96.7%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-96.7%

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{0 - \left(t - a\right)}} + x \]
      8. sub0-neg96.7%

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{-1 \cdot \left(t - a\right)}} + x \]
      10. times-frac99.9%

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg99.9%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative99.9%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub099.9%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-99.9%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg99.9%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-199.9%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      18. *-commutative99.9%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*99.9%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval99.9%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity99.9%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified99.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z - t}{a - t} \leq 5 \cdot 10^{+54}:\\ \;\;\;\;x + \frac{z - t}{a - t} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t - z, \frac{y}{t - a}, x\right)\\ \end{array} \]

Alternative 2: 77.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \frac{z - t}{a}\\ \mathbf{if}\;t \leq -2.15 \cdot 10^{+24}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -9 \cdot 10^{-10}:\\ \;\;\;\;\left(t - z\right) \cdot \frac{y}{t - a}\\ \mathbf{elif}\;t \leq 10^{-80}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 6 \cdot 10^{-39}:\\ \;\;\;\;x - z \cdot \frac{y}{t}\\ \mathbf{elif}\;t \leq 3.1 \cdot 10^{+103}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* y (/ (- z t) a)))))
   (if (<= t -2.15e+24)
     (+ x y)
     (if (<= t -9e-10)
       (* (- t z) (/ y (- t a)))
       (if (<= t 1e-80)
         t_1
         (if (<= t 6e-39)
           (- x (* z (/ y t)))
           (if (<= t 3.1e+103) t_1 (+ x y))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * ((z - t) / a));
	double tmp;
	if (t <= -2.15e+24) {
		tmp = x + y;
	} else if (t <= -9e-10) {
		tmp = (t - z) * (y / (t - a));
	} else if (t <= 1e-80) {
		tmp = t_1;
	} else if (t <= 6e-39) {
		tmp = x - (z * (y / t));
	} else if (t <= 3.1e+103) {
		tmp = t_1;
	} else {
		tmp = x + y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + (y * ((z - t) / a))
    if (t <= (-2.15d+24)) then
        tmp = x + y
    else if (t <= (-9d-10)) then
        tmp = (t - z) * (y / (t - a))
    else if (t <= 1d-80) then
        tmp = t_1
    else if (t <= 6d-39) then
        tmp = x - (z * (y / t))
    else if (t <= 3.1d+103) then
        tmp = t_1
    else
        tmp = x + y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * ((z - t) / a));
	double tmp;
	if (t <= -2.15e+24) {
		tmp = x + y;
	} else if (t <= -9e-10) {
		tmp = (t - z) * (y / (t - a));
	} else if (t <= 1e-80) {
		tmp = t_1;
	} else if (t <= 6e-39) {
		tmp = x - (z * (y / t));
	} else if (t <= 3.1e+103) {
		tmp = t_1;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y * ((z - t) / a))
	tmp = 0
	if t <= -2.15e+24:
		tmp = x + y
	elif t <= -9e-10:
		tmp = (t - z) * (y / (t - a))
	elif t <= 1e-80:
		tmp = t_1
	elif t <= 6e-39:
		tmp = x - (z * (y / t))
	elif t <= 3.1e+103:
		tmp = t_1
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / a)))
	tmp = 0.0
	if (t <= -2.15e+24)
		tmp = Float64(x + y);
	elseif (t <= -9e-10)
		tmp = Float64(Float64(t - z) * Float64(y / Float64(t - a)));
	elseif (t <= 1e-80)
		tmp = t_1;
	elseif (t <= 6e-39)
		tmp = Float64(x - Float64(z * Float64(y / t)));
	elseif (t <= 3.1e+103)
		tmp = t_1;
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y * ((z - t) / a));
	tmp = 0.0;
	if (t <= -2.15e+24)
		tmp = x + y;
	elseif (t <= -9e-10)
		tmp = (t - z) * (y / (t - a));
	elseif (t <= 1e-80)
		tmp = t_1;
	elseif (t <= 6e-39)
		tmp = x - (z * (y / t));
	elseif (t <= 3.1e+103)
		tmp = t_1;
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.15e+24], N[(x + y), $MachinePrecision], If[LessEqual[t, -9e-10], N[(N[(t - z), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-80], t$95$1, If[LessEqual[t, 6e-39], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.1e+103], t$95$1, N[(x + y), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a}\\
\mathbf{if}\;t \leq -2.15 \cdot 10^{+24}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;t \leq -9 \cdot 10^{-10}:\\
\;\;\;\;\left(t - z\right) \cdot \frac{y}{t - a}\\

\mathbf{elif}\;t \leq 10^{-80}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 6 \cdot 10^{-39}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\

\mathbf{elif}\;t \leq 3.1 \cdot 10^{+103}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.14999999999999994e24 or 3.1000000000000002e103 < t

    1. Initial program 100.0%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative100.0%

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

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/76.7%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-76.7%

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{0 - \left(t - a\right)}} + x \]
      8. sub0-neg76.7%

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def89.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg89.3%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative89.3%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub089.3%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-89.3%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg89.3%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-189.3%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      18. *-commutative89.3%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*89.3%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval89.3%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity89.3%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified89.3%

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

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

    if -2.14999999999999994e24 < t < -8.9999999999999999e-10

    1. Initial program 99.3%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative99.3%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t} + x} \]
      2. *-commutative99.3%

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/89.5%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-89.5%

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{0 - \left(t - a\right)}} + x \]
      8. sub0-neg89.5%

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def99.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg99.7%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative99.7%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub099.7%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-99.7%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg99.7%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-199.7%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      18. *-commutative99.7%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*99.7%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval99.7%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity99.7%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified99.7%

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(t - z\right)}{t - a}} \]
    5. Step-by-step derivation
      1. *-commutative89.5%

        \[\leadsto \frac{\color{blue}{\left(t - z\right) \cdot y}}{t - a} \]
      2. associate-*r/99.7%

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

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

    if -8.9999999999999999e-10 < t < 9.99999999999999961e-81 or 6.00000000000000055e-39 < t < 3.1000000000000002e103

    1. Initial program 96.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in a around inf 84.1%

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

    if 9.99999999999999961e-81 < t < 6.00000000000000055e-39

    1. Initial program 81.2%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative81.2%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t} + x} \]
      2. *-commutative81.2%

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/99.8%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-99.8%

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{0 - \left(t - a\right)}} + x \]
      8. sub0-neg99.8%

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg100.0%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative100.0%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub0100.0%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-100.0%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg100.0%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-1100.0%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      18. *-commutative100.0%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*100.0%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval100.0%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity100.0%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - z, \frac{y}{t - a}, x\right)} \]
    4. Taylor expanded in a around 0 90.0%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{t - z}}} \]
    6. Simplified61.9%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{t - z}}} \]
    7. Taylor expanded in t around 0 90.0%

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

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

        \[\leadsto x + \frac{\color{blue}{-y \cdot z}}{t} \]
    9. Simplified90.0%

      \[\leadsto x + \color{blue}{\frac{-y \cdot z}{t}} \]
    10. Step-by-step derivation
      1. div-inv90.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-1\right) \cdot \color{blue}{\left(\left(\left(-y\right) \cdot z\right) \cdot \frac{1}{t}\right)} \]
      15. distribute-lft-neg-in40.7%

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

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

        \[\leadsto \color{blue}{x - 1 \cdot \frac{-y \cdot z}{t}} \]
      18. *-un-lft-identity40.7%

        \[\leadsto x - \color{blue}{\frac{-y \cdot z}{t}} \]
      19. div-inv40.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.15 \cdot 10^{+24}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -9 \cdot 10^{-10}:\\ \;\;\;\;\left(t - z\right) \cdot \frac{y}{t - a}\\ \mathbf{elif}\;t \leq 10^{-80}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a}\\ \mathbf{elif}\;t \leq 6 \cdot 10^{-39}:\\ \;\;\;\;x - z \cdot \frac{y}{t}\\ \mathbf{elif}\;t \leq 3.1 \cdot 10^{+103}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 3: 98.5% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 99.4%

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

    if 2.00000000000000009e245 < (/.f64 (-.f64 z t) (-.f64 a t))

    1. Initial program 41.7%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative41.7%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t} + x} \]
      2. *-commutative41.7%

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/100.0%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-100.0%

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{0 - \left(t - a\right)}} + x \]
      8. sub0-neg100.0%

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg99.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative99.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub099.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-99.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg99.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-199.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      18. *-commutative99.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*99.8%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval99.8%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity99.8%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified99.8%

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

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

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

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

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

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

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

Alternative 4: 98.4% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 99.3%

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

    if 2.00000000000000002e78 < (/.f64 (-.f64 z t) (-.f64 a t))

    1. Initial program 81.3%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. associate-*r/99.9%

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

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

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

Alternative 5: 81.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \frac{z - t}{a}\\ t_2 := x + \frac{y}{\frac{t}{t - z}}\\ \mathbf{if}\;t \leq -3.6 \cdot 10^{-44}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-81}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.05 \cdot 10^{-41}:\\ \;\;\;\;x - z \cdot \frac{y}{t}\\ \mathbf{elif}\;t \leq 1.95 \cdot 10^{+100}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* y (/ (- z t) a)))) (t_2 (+ x (/ y (/ t (- t z))))))
   (if (<= t -3.6e-44)
     t_2
     (if (<= t 8.5e-81)
       t_1
       (if (<= t 2.05e-41)
         (- x (* z (/ y t)))
         (if (<= t 1.95e+100) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * ((z - t) / a));
	double t_2 = x + (y / (t / (t - z)));
	double tmp;
	if (t <= -3.6e-44) {
		tmp = t_2;
	} else if (t <= 8.5e-81) {
		tmp = t_1;
	} else if (t <= 2.05e-41) {
		tmp = x - (z * (y / t));
	} else if (t <= 1.95e+100) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + (y * ((z - t) / a))
    t_2 = x + (y / (t / (t - z)))
    if (t <= (-3.6d-44)) then
        tmp = t_2
    else if (t <= 8.5d-81) then
        tmp = t_1
    else if (t <= 2.05d-41) then
        tmp = x - (z * (y / t))
    else if (t <= 1.95d+100) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * ((z - t) / a));
	double t_2 = x + (y / (t / (t - z)));
	double tmp;
	if (t <= -3.6e-44) {
		tmp = t_2;
	} else if (t <= 8.5e-81) {
		tmp = t_1;
	} else if (t <= 2.05e-41) {
		tmp = x - (z * (y / t));
	} else if (t <= 1.95e+100) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y * ((z - t) / a))
	t_2 = x + (y / (t / (t - z)))
	tmp = 0
	if t <= -3.6e-44:
		tmp = t_2
	elif t <= 8.5e-81:
		tmp = t_1
	elif t <= 2.05e-41:
		tmp = x - (z * (y / t))
	elif t <= 1.95e+100:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / a)))
	t_2 = Float64(x + Float64(y / Float64(t / Float64(t - z))))
	tmp = 0.0
	if (t <= -3.6e-44)
		tmp = t_2;
	elseif (t <= 8.5e-81)
		tmp = t_1;
	elseif (t <= 2.05e-41)
		tmp = Float64(x - Float64(z * Float64(y / t)));
	elseif (t <= 1.95e+100)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y * ((z - t) / a));
	t_2 = x + (y / (t / (t - z)));
	tmp = 0.0;
	if (t <= -3.6e-44)
		tmp = t_2;
	elseif (t <= 8.5e-81)
		tmp = t_1;
	elseif (t <= 2.05e-41)
		tmp = x - (z * (y / t));
	elseif (t <= 1.95e+100)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y / N[(t / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.6e-44], t$95$2, If[LessEqual[t, 8.5e-81], t$95$1, If[LessEqual[t, 2.05e-41], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.95e+100], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 8.5 \cdot 10^{-81}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 2.05 \cdot 10^{-41}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\

\mathbf{elif}\;t \leq 1.95 \cdot 10^{+100}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.5999999999999999e-44 or 1.95e100 < t

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t} + x} \]
      2. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/79.5%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-79.5%

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{0 - \left(t - a\right)}} + x \]
      8. sub0-neg79.5%

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def90.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg90.1%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative90.1%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub090.1%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-90.1%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg90.1%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-190.1%

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*90.1%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval90.1%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity90.1%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified90.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - z, \frac{y}{t - a}, x\right)} \]
    4. Taylor expanded in a around 0 72.1%

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

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

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

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

    if -3.5999999999999999e-44 < t < 8.5000000000000001e-81 or 2.05000000000000007e-41 < t < 1.95e100

    1. Initial program 96.7%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in a around inf 86.1%

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

    if 8.5000000000000001e-81 < t < 2.05000000000000007e-41

    1. Initial program 81.2%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative81.2%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t} + x} \]
      2. *-commutative81.2%

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/99.8%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-99.8%

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{0 - \left(t - a\right)}} + x \]
      8. sub0-neg99.8%

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg100.0%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative100.0%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub0100.0%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-100.0%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg100.0%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-1100.0%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      18. *-commutative100.0%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*100.0%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval100.0%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity100.0%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - z, \frac{y}{t - a}, x\right)} \]
    4. Taylor expanded in a around 0 90.0%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{t - z}}} \]
    6. Simplified61.9%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{t - z}}} \]
    7. Taylor expanded in t around 0 90.0%

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

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

        \[\leadsto x + \frac{\color{blue}{-y \cdot z}}{t} \]
    9. Simplified90.0%

      \[\leadsto x + \color{blue}{\frac{-y \cdot z}{t}} \]
    10. Step-by-step derivation
      1. div-inv90.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-1\right) \cdot \color{blue}{\left(\left(\left(-y\right) \cdot z\right) \cdot \frac{1}{t}\right)} \]
      15. distribute-lft-neg-in40.7%

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

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

        \[\leadsto \color{blue}{x - 1 \cdot \frac{-y \cdot z}{t}} \]
      18. *-un-lft-identity40.7%

        \[\leadsto x - \color{blue}{\frac{-y \cdot z}{t}} \]
      19. div-inv40.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.6 \cdot 10^{-44}:\\ \;\;\;\;x + \frac{y}{\frac{t}{t - z}}\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-81}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a}\\ \mathbf{elif}\;t \leq 2.05 \cdot 10^{-41}:\\ \;\;\;\;x - z \cdot \frac{y}{t}\\ \mathbf{elif}\;t \leq 1.95 \cdot 10^{+100}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{t}{t - z}}\\ \end{array} \]

Alternative 6: 76.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+24}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;t \leq -5.4 \cdot 10^{-11}:\\
\;\;\;\;\left(t - z\right) \cdot \frac{y}{t - a}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.2e24 or 5.00000000000000022e41 < t

    1. Initial program 100.0%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative100.0%

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

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/78.2%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-78.2%

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def90.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg90.3%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative90.3%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub090.3%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-90.3%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg90.3%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-190.3%

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*90.3%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval90.3%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity90.3%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified90.3%

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

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

    if -1.2e24 < t < -5.40000000000000009e-11

    1. Initial program 99.3%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative99.3%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t} + x} \]
      2. *-commutative99.3%

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/89.5%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-89.5%

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{0 - \left(t - a\right)}} + x \]
      8. sub0-neg89.5%

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def99.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg99.7%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative99.7%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub099.7%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-99.7%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg99.7%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-199.7%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      18. *-commutative99.7%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*99.7%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval99.7%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity99.7%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified99.7%

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(t - z\right)}{t - a}} \]
    5. Step-by-step derivation
      1. *-commutative89.5%

        \[\leadsto \frac{\color{blue}{\left(t - z\right) \cdot y}}{t - a} \]
      2. associate-*r/99.7%

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

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

    if -5.40000000000000009e-11 < t < 4.99999999999999981e-81

    1. Initial program 96.3%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative96.3%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t} + x} \]
      2. *-commutative96.3%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(-t\right) + a}} + x \]
      6. neg-sub097.4%

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-97.4%

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def96.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg96.6%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative96.6%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub096.6%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-96.6%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg96.6%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-196.6%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      18. *-commutative96.6%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*96.6%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval96.6%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity96.6%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified96.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - z, \frac{y}{t - a}, x\right)} \]
    4. Taylor expanded in t around 0 81.2%

      \[\leadsto \color{blue}{\frac{y \cdot z}{a} + x} \]
    5. Step-by-step derivation
      1. associate-/l*82.8%

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} + x \]
    6. Simplified82.8%

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

    if 4.99999999999999981e-81 < t < 5.00000000000000022e41

    1. Initial program 90.6%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative90.6%

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

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/99.8%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-99.8%

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{0 - \left(t - a\right)}} + x \]
      8. sub0-neg99.8%

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg99.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative99.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub099.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-99.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg99.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-199.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      18. *-commutative99.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*99.8%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval99.8%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity99.8%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - z, \frac{y}{t - a}, x\right)} \]
    4. Taylor expanded in a around 0 75.4%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{t - z}}} \]
    6. Simplified61.3%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{t - z}}} \]
    7. Taylor expanded in t around 0 75.6%

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

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

        \[\leadsto x + \frac{\color{blue}{-y \cdot z}}{t} \]
    9. Simplified75.6%

      \[\leadsto x + \color{blue}{\frac{-y \cdot z}{t}} \]
    10. Step-by-step derivation
      1. div-inv75.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-1\right) \cdot \color{blue}{\left(\left(\left(-y\right) \cdot z\right) \cdot \frac{1}{t}\right)} \]
      15. distribute-lft-neg-in45.7%

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

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

        \[\leadsto \color{blue}{x - 1 \cdot \frac{-y \cdot z}{t}} \]
      18. *-un-lft-identity45.7%

        \[\leadsto x - \color{blue}{\frac{-y \cdot z}{t}} \]
      19. div-inv45.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.2 \cdot 10^{+24}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -5.4 \cdot 10^{-11}:\\ \;\;\;\;\left(t - z\right) \cdot \frac{y}{t - a}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{-81}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{+41}:\\ \;\;\;\;x - z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 7: 76.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-40}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;t \leq 6.5 \cdot 10^{-81}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -8.4999999999999998e-40 or 2.15e39 < t

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t} + x} \]
      2. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/80.3%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-80.3%

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def90.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg90.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative90.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub090.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-90.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg90.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-190.8%

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*90.8%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval90.8%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity90.8%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified90.8%

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

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

    if -8.4999999999999998e-40 < t < 6.5000000000000002e-81

    1. Initial program 96.1%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative96.1%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t} + x} \]
      2. *-commutative96.1%

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/97.3%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-97.3%

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def97.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg97.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative97.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub097.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-97.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg97.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-197.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      18. *-commutative97.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*97.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval97.2%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity97.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified97.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - z, \frac{y}{t - a}, x\right)} \]
    4. Taylor expanded in t around 0 83.4%

      \[\leadsto \color{blue}{\frac{y \cdot z}{a} + x} \]
    5. Step-by-step derivation
      1. associate-/l*85.2%

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} + x \]
    6. Simplified85.2%

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

    if 6.5000000000000002e-81 < t < 2.15e39

    1. Initial program 90.6%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative90.6%

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

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/99.8%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-99.8%

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{0 - \left(t - a\right)}} + x \]
      8. sub0-neg99.8%

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg99.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative99.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub099.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-99.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg99.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-199.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      18. *-commutative99.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*99.8%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval99.8%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity99.8%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - z, \frac{y}{t - a}, x\right)} \]
    4. Taylor expanded in a around 0 75.4%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{t - z}}} \]
    6. Simplified61.3%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{t - z}}} \]
    7. Taylor expanded in t around 0 75.6%

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

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

        \[\leadsto x + \frac{\color{blue}{-y \cdot z}}{t} \]
    9. Simplified75.6%

      \[\leadsto x + \color{blue}{\frac{-y \cdot z}{t}} \]
    10. Step-by-step derivation
      1. div-inv75.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-1\right) \cdot \color{blue}{\left(\left(\left(-y\right) \cdot z\right) \cdot \frac{1}{t}\right)} \]
      15. distribute-lft-neg-in45.7%

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

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

        \[\leadsto \color{blue}{x - 1 \cdot \frac{-y \cdot z}{t}} \]
      18. *-un-lft-identity45.7%

        \[\leadsto x - \color{blue}{\frac{-y \cdot z}{t}} \]
      19. div-inv45.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{-40}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{-81}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 2.15 \cdot 10^{+39}:\\ \;\;\;\;x - z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 8: 76.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{-40} \lor \neg \left(t \leq 150\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.5000000000000001e-40 or 150 < t

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t} + x} \]
      2. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/81.2%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-81.2%

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def91.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg91.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative91.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub091.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-91.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg91.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-191.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      18. *-commutative91.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*91.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval91.2%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity91.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified91.2%

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

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

    if -1.5000000000000001e-40 < t < 150

    1. Initial program 95.0%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in t around 0 81.3%

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

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

Alternative 9: 76.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-41} \lor \neg \left(t \leq 820\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.50000000000000049e-41 or 820 < t

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t} + x} \]
      2. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/81.2%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-81.2%

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def91.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg91.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative91.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub091.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-91.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg91.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-191.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      18. *-commutative91.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*91.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval91.2%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity91.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified91.2%

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

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

    if -7.50000000000000049e-41 < t < 820

    1. Initial program 95.0%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative95.0%

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

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/97.6%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-97.6%

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def97.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg97.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative97.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub097.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-97.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg97.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-197.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      18. *-commutative97.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*97.5%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval97.5%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity97.5%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified97.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - z, \frac{y}{t - a}, x\right)} \]
    4. Taylor expanded in t around 0 79.8%

      \[\leadsto \color{blue}{\frac{y \cdot z}{a} + x} \]
    5. Step-by-step derivation
      1. associate-/l*81.3%

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} + x \]
    6. Simplified81.3%

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

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

Alternative 10: 63.0% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{-44}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;t \leq 38:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.9999999999999995e-44 or 38 < t

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t} + x} \]
      2. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/81.2%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-81.2%

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def91.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg91.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative91.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub091.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-91.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg91.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-191.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      18. *-commutative91.2%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*91.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval91.2%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity91.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified91.2%

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

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

    if -6.9999999999999995e-44 < t < 38

    1. Initial program 95.0%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative95.0%

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

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/97.6%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-97.6%

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def97.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg97.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative97.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub097.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-97.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg97.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-197.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      18. *-commutative97.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*97.5%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval97.5%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity97.5%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified97.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7 \cdot 10^{-44}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 38:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 11: 53.0% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{+103}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{+208}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= y -5.8e+103) y (if (<= y 1.95e+208) x y)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -5.8e+103) {
		tmp = y;
	} else if (y <= 1.95e+208) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (y <= (-5.8d+103)) then
        tmp = y
    else if (y <= 1.95d+208) then
        tmp = x
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -5.8e+103) {
		tmp = y;
	} else if (y <= 1.95e+208) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if y <= -5.8e+103:
		tmp = y
	elif y <= 1.95e+208:
		tmp = x
	else:
		tmp = y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (y <= -5.8e+103)
		tmp = y;
	elseif (y <= 1.95e+208)
		tmp = x;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (y <= -5.8e+103)
		tmp = y;
	elseif (y <= 1.95e+208)
		tmp = x;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5.8e+103], y, If[LessEqual[y, 1.95e+208], x, y]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+103}:\\
\;\;\;\;y\\

\mathbf{elif}\;y \leq 1.95 \cdot 10^{+208}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.7999999999999997e103 or 1.95e208 < y

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t} + x} \]
      2. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/67.2%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-67.2%

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def93.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg93.3%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative93.3%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub093.3%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-93.3%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg93.3%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-193.3%

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*93.3%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval93.3%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity93.3%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified93.3%

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(t - z\right)}{t - a}} \]
    5. Step-by-step derivation
      1. *-commutative55.9%

        \[\leadsto \frac{\color{blue}{\left(t - z\right) \cdot y}}{t - a} \]
      2. associate-*r/79.6%

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t - a}{t}}} \]
    9. Simplified45.8%

      \[\leadsto \color{blue}{\frac{y}{\frac{t - a}{t}}} \]
    10. Taylor expanded in t around inf 36.7%

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

    if -5.7999999999999997e103 < y < 1.95e208

    1. Initial program 96.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative96.9%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t} + x} \]
      2. *-commutative96.9%

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
      3. associate-*l/95.1%

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

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

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

        \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(0 - t\right)} + a} + x \]
      7. associate-+l-95.1%

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def94.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
      12. sub-neg94.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      13. +-commutative94.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub094.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-94.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg94.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-194.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      18. *-commutative94.5%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*94.5%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
      20. metadata-eval94.5%

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity94.5%

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
    3. Simplified94.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - z, \frac{y}{t - a}, x\right)} \]
    4. Taylor expanded in y around 0 60.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{+103}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{+208}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 12: 50.3% accurate, 11.0× speedup?

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

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

    \[x + y \cdot \frac{z - t}{a - t} \]
  2. Step-by-step derivation
    1. +-commutative97.6%

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

      \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} + x \]
    3. associate-*l/88.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
    11. fma-def94.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{-1}, \frac{y}{t - a}, x\right)} \]
    12. sub-neg94.2%

      \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z + \left(-t\right)}}{-1}, \frac{y}{t - a}, x\right) \]
    13. +-commutative94.2%

      \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
    14. neg-sub094.2%

      \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
    15. associate-+l-94.2%

      \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
    16. sub0-neg94.2%

      \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
    17. neg-mul-194.2%

      \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
    18. *-commutative94.2%

      \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
    19. associate-/l*94.2%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - z}{\frac{-1}{-1}}}, \frac{y}{t - a}, x\right) \]
    20. metadata-eval94.2%

      \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
    21. /-rgt-identity94.2%

      \[\leadsto \mathsf{fma}\left(\color{blue}{t - z}, \frac{y}{t - a}, x\right) \]
  3. Simplified94.2%

    \[\leadsto \color{blue}{\mathsf{fma}\left(t - z, \frac{y}{t - a}, x\right)} \]
  4. Taylor expanded in y around 0 50.5%

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

    \[\leadsto x \]

Developer target: 99.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023181 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
  :precision binary64

  :herbie-target
  (if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

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