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

Percentage Accurate: 98.0% → 98.2%
Time: 11.1s
Alternatives: 17
Speedup: 1.0×

Specification

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

\\
x + y \cdot \frac{z - t}{z - a}
\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 17 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.0% accurate, 1.0× speedup?

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

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

Alternative 1: 98.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{y}{\frac{z - a}{z - t}} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
	return x + (y / ((z - a) / (z - 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 - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a):
	return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a)
	return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t))))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (y / ((z - a) / (z - t)));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[x + y \cdot \frac{z - t}{z - a} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. clear-num98.8%

      \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{z - a}{z - t}}} \]
    2. un-div-inv98.8%

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

    \[\leadsto x + \color{blue}{\frac{y}{\frac{z - a}{z - t}}} \]
  5. Add Preprocessing

Alternative 2: 96.0% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-6}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\

\mathbf{elif}\;t\_1 \leq 1000000:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\

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


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

    1. Initial program 97.3%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num97.5%

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{z - a}{z - t}}} \]
      2. un-div-inv97.5%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{z - a}{z - t}}} \]
    4. Applied egg-rr97.5%

      \[\leadsto x + \color{blue}{\frac{y}{\frac{z - a}{z - t}}} \]
    5. Taylor expanded in t around inf 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y \cdot \left(-t\right)}{z - a}} \]
      10. add-sqr-sqrt17.7%

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

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

        \[\leadsto x - \frac{y \cdot \sqrt{\color{blue}{t \cdot t}}}{z - a} \]
      13. sqrt-unprod54.1%

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

        \[\leadsto x - \frac{y \cdot \color{blue}{t}}{z - a} \]
    9. Applied egg-rr99.1%

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

    if -4.9999999999999998e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 3.99999999999999982e-6

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999982e-6 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e6

    1. Initial program 100.0%

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

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

    if 1e6 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 97.5%

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

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

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

        \[\leadsto x + \frac{\color{blue}{-t \cdot y}}{z - a} \]
      3. distribute-lft-neg-out90.1%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{-t}{z - a}} \]
      7. /-rgt-identity96.7%

        \[\leadsto x + \color{blue}{y} \cdot \frac{-t}{z - a} \]
      8. distribute-neg-frac96.7%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \leq -5 \cdot 10^{-8}:\\ \;\;\;\;x + \frac{y \cdot t}{a - z}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 4 \cdot 10^{-6}:\\ \;\;\;\;x + y \cdot \frac{t - z}{a}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 1000000:\\ \;\;\;\;x - y \cdot \frac{t - z}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 96.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{z - a}\\ t_2 := x + y \cdot \frac{t}{a - z}\\ \mathbf{if}\;t\_1 \leq -2000000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-6}:\\ \;\;\;\;x + y \cdot \frac{t - z}{a}\\ \mathbf{elif}\;t\_1 \leq 1000000:\\ \;\;\;\;x - y \cdot \frac{t - z}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- z t) (- z a))) (t_2 (+ x (* y (/ t (- a z))))))
   (if (<= t_1 -2000000000.0)
     t_2
     (if (<= t_1 4e-6)
       (+ x (* y (/ (- t z) a)))
       (if (<= t_1 1000000.0) (- x (* y (/ (- t z) z))) t_2)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (z - t) / (z - a);
	double t_2 = x + (y * (t / (a - z)));
	double tmp;
	if (t_1 <= -2000000000.0) {
		tmp = t_2;
	} else if (t_1 <= 4e-6) {
		tmp = x + (y * ((t - z) / a));
	} else if (t_1 <= 1000000.0) {
		tmp = x - (y * ((t - z) / z));
	} 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 = (z - t) / (z - a)
    t_2 = x + (y * (t / (a - z)))
    if (t_1 <= (-2000000000.0d0)) then
        tmp = t_2
    else if (t_1 <= 4d-6) then
        tmp = x + (y * ((t - z) / a))
    else if (t_1 <= 1000000.0d0) then
        tmp = x - (y * ((t - z) / z))
    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 = (z - t) / (z - a);
	double t_2 = x + (y * (t / (a - z)));
	double tmp;
	if (t_1 <= -2000000000.0) {
		tmp = t_2;
	} else if (t_1 <= 4e-6) {
		tmp = x + (y * ((t - z) / a));
	} else if (t_1 <= 1000000.0) {
		tmp = x - (y * ((t - z) / z));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (z - t) / (z - a)
	t_2 = x + (y * (t / (a - z)))
	tmp = 0
	if t_1 <= -2000000000.0:
		tmp = t_2
	elif t_1 <= 4e-6:
		tmp = x + (y * ((t - z) / a))
	elif t_1 <= 1000000.0:
		tmp = x - (y * ((t - z) / z))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(z - t) / Float64(z - a))
	t_2 = Float64(x + Float64(y * Float64(t / Float64(a - z))))
	tmp = 0.0
	if (t_1 <= -2000000000.0)
		tmp = t_2;
	elseif (t_1 <= 4e-6)
		tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a)));
	elseif (t_1 <= 1000000.0)
		tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (z - t) / (z - a);
	t_2 = x + (y * (t / (a - z)));
	tmp = 0.0;
	if (t_1 <= -2000000000.0)
		tmp = t_2;
	elseif (t_1 <= 4e-6)
		tmp = x + (y * ((t - z) / a));
	elseif (t_1 <= 1000000.0)
		tmp = x - (y * ((t - z) / z));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2000000000.0], t$95$2, If[LessEqual[t$95$1, 4e-6], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1000000.0], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := x + y \cdot \frac{t}{a - z}\\
\mathbf{if}\;t\_1 \leq -2000000000:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-6}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\

\mathbf{elif}\;t\_1 \leq 1000000:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


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

    1. Initial program 97.4%

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

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

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

        \[\leadsto x + \frac{\color{blue}{-t \cdot y}}{z - a} \]
      3. distribute-lft-neg-out94.6%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{-t}{z - a}} \]
      7. /-rgt-identity96.5%

        \[\leadsto x + \color{blue}{y} \cdot \frac{-t}{z - a} \]
      8. distribute-neg-frac96.5%

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

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

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

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

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

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

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

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

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

    if -2e9 < (/.f64 (-.f64 z t) (-.f64 z a)) < 3.99999999999999982e-6

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999982e-6 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e6

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \leq -2000000000:\\ \;\;\;\;x + y \cdot \frac{t}{a - z}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 4 \cdot 10^{-6}:\\ \;\;\;\;x + y \cdot \frac{t - z}{a}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 1000000:\\ \;\;\;\;x - y \cdot \frac{t - z}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 92.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{z - a}\\ t_2 := x + y \cdot \frac{t}{a - z}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-8}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-6}:\\ \;\;\;\;x - y \cdot \frac{z}{a}\\ \mathbf{elif}\;t\_1 \leq 1000000:\\ \;\;\;\;x - y \cdot \frac{t - z}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- z t) (- z a))) (t_2 (+ x (* y (/ t (- a z))))))
   (if (<= t_1 -5e-8)
     t_2
     (if (<= t_1 4e-6)
       (- x (* y (/ z a)))
       (if (<= t_1 1000000.0) (- x (* y (/ (- t z) z))) t_2)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (z - t) / (z - a);
	double t_2 = x + (y * (t / (a - z)));
	double tmp;
	if (t_1 <= -5e-8) {
		tmp = t_2;
	} else if (t_1 <= 4e-6) {
		tmp = x - (y * (z / a));
	} else if (t_1 <= 1000000.0) {
		tmp = x - (y * ((t - z) / z));
	} 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 = (z - t) / (z - a)
    t_2 = x + (y * (t / (a - z)))
    if (t_1 <= (-5d-8)) then
        tmp = t_2
    else if (t_1 <= 4d-6) then
        tmp = x - (y * (z / a))
    else if (t_1 <= 1000000.0d0) then
        tmp = x - (y * ((t - z) / z))
    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 = (z - t) / (z - a);
	double t_2 = x + (y * (t / (a - z)));
	double tmp;
	if (t_1 <= -5e-8) {
		tmp = t_2;
	} else if (t_1 <= 4e-6) {
		tmp = x - (y * (z / a));
	} else if (t_1 <= 1000000.0) {
		tmp = x - (y * ((t - z) / z));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (z - t) / (z - a)
	t_2 = x + (y * (t / (a - z)))
	tmp = 0
	if t_1 <= -5e-8:
		tmp = t_2
	elif t_1 <= 4e-6:
		tmp = x - (y * (z / a))
	elif t_1 <= 1000000.0:
		tmp = x - (y * ((t - z) / z))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(z - t) / Float64(z - a))
	t_2 = Float64(x + Float64(y * Float64(t / Float64(a - z))))
	tmp = 0.0
	if (t_1 <= -5e-8)
		tmp = t_2;
	elseif (t_1 <= 4e-6)
		tmp = Float64(x - Float64(y * Float64(z / a)));
	elseif (t_1 <= 1000000.0)
		tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (z - t) / (z - a);
	t_2 = x + (y * (t / (a - z)));
	tmp = 0.0;
	if (t_1 <= -5e-8)
		tmp = t_2;
	elseif (t_1 <= 4e-6)
		tmp = x - (y * (z / a));
	elseif (t_1 <= 1000000.0)
		tmp = x - (y * ((t - z) / z));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-8], t$95$2, If[LessEqual[t$95$1, 4e-6], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1000000.0], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t\_1 \leq 1000000:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


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

    1. Initial program 97.4%

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

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

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

        \[\leadsto x + \frac{\color{blue}{-t \cdot y}}{z - a} \]
      3. distribute-lft-neg-out94.7%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{-t}{z - a}} \]
      7. /-rgt-identity96.6%

        \[\leadsto x + \color{blue}{y} \cdot \frac{-t}{z - a} \]
      8. distribute-neg-frac96.6%

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

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

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

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

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

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

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

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

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

    if -4.9999999999999998e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 3.99999999999999982e-6

    1. Initial program 99.0%

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

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

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

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

      \[\leadsto \color{blue}{x + \frac{y \cdot z}{z - a}} \]
    6. Step-by-step derivation
      1. +-commutative80.3%

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

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

      \[\leadsto \color{blue}{y \cdot \frac{z}{z - a} + x} \]
    8. Taylor expanded in z around 0 79.5%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot z}{a}} \]
    9. Step-by-step derivation
      1. mul-1-neg79.5%

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{z}{a}} \]
    10. Simplified86.0%

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

    if 3.99999999999999982e-6 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e6

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \leq -5 \cdot 10^{-8}:\\ \;\;\;\;x + y \cdot \frac{t}{a - z}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 4 \cdot 10^{-6}:\\ \;\;\;\;x - y \cdot \frac{z}{a}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 1000000:\\ \;\;\;\;x - y \cdot \frac{t - z}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 91.9% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t\_1 \leq 1.00001:\\
\;\;\;\;x + y\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


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

    1. Initial program 97.5%

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

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

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

        \[\leadsto x + \frac{\color{blue}{-t \cdot y}}{z - a} \]
      3. distribute-lft-neg-out94.3%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{-t}{z - a}} \]
      7. /-rgt-identity96.1%

        \[\leadsto x + \color{blue}{y} \cdot \frac{-t}{z - a} \]
      8. distribute-neg-frac96.1%

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

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

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

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

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

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

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

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

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

    if -4.9999999999999998e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 3.99999999999999982e-6

    1. Initial program 99.0%

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

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

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

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

      \[\leadsto \color{blue}{x + \frac{y \cdot z}{z - a}} \]
    6. Step-by-step derivation
      1. +-commutative80.3%

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

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

      \[\leadsto \color{blue}{y \cdot \frac{z}{z - a} + x} \]
    8. Taylor expanded in z around 0 79.5%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot z}{a}} \]
    9. Step-by-step derivation
      1. mul-1-neg79.5%

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{z}{a}} \]
    10. Simplified86.0%

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

    if 3.99999999999999982e-6 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000100000000001

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative98.7%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified98.7%

      \[\leadsto \color{blue}{y + x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification93.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \leq -5 \cdot 10^{-8}:\\ \;\;\;\;x + y \cdot \frac{t}{a - z}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 4 \cdot 10^{-6}:\\ \;\;\;\;x - y \cdot \frac{z}{a}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 1.00001:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 82.4% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-8}:\\
\;\;\;\;y \cdot t\_1\\

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+35}:\\
\;\;\;\;x + y\\

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


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

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

    if -4.0000000000000001e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 3.99999999999999982e-6

    1. Initial program 98.9%

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

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

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

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

      \[\leadsto \color{blue}{x + \frac{y \cdot z}{z - a}} \]
    6. Step-by-step derivation
      1. +-commutative81.0%

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

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

      \[\leadsto \color{blue}{y \cdot \frac{z}{z - a} + x} \]
    8. Taylor expanded in z around 0 80.3%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot z}{a}} \]
    9. Step-by-step derivation
      1. mul-1-neg80.3%

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{z}{a}} \]
    10. Simplified86.3%

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

    if 3.99999999999999982e-6 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5.00000000000000021e35

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative96.8%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified96.8%

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

    if 5.00000000000000021e35 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
    11. Taylor expanded in t around inf 62.1%

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

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

        \[\leadsto x + \frac{\color{blue}{-t \cdot y}}{z - a} \]
      3. distribute-lft-neg-out91.8%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{-t}{z - a}} \]
      7. /-rgt-identity97.2%

        \[\leadsto x + \color{blue}{y} \cdot \frac{-t}{z - a} \]
      8. distribute-neg-frac97.2%

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

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

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

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

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

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

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

        \[\leadsto x + y \cdot \frac{t}{\color{blue}{a} - z} \]
    13. Simplified67.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \leq -4 \cdot 10^{-8}:\\ \;\;\;\;y \cdot \frac{z - t}{z - a}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 4 \cdot 10^{-6}:\\ \;\;\;\;x - y \cdot \frac{z}{a}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 5 \cdot 10^{+35}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 92.3% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-8} \lor \neg \left(t\_1 \leq 1.00001\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\

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


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

    1. Initial program 97.5%

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

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

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

        \[\leadsto x + \frac{\color{blue}{-t \cdot y}}{z - a} \]
      3. distribute-lft-neg-out94.3%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{-t}{z - a}} \]
      7. /-rgt-identity96.1%

        \[\leadsto x + \color{blue}{y} \cdot \frac{-t}{z - a} \]
      8. distribute-neg-frac96.1%

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

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

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

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

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

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

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

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

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

    if -4.9999999999999998e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000100000000001

    1. Initial program 99.4%

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

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

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

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

      \[\leadsto \color{blue}{x + \frac{y \cdot z}{z - a}} \]
    6. Step-by-step derivation
      1. +-commutative80.9%

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{z - a}} + x \]
    7. Simplified92.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \leq -5 \cdot 10^{-8} \lor \neg \left(\frac{z - t}{z - a} \leq 1.00001\right):\\ \;\;\;\;x + y \cdot \frac{t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 77.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-15}:\\
\;\;\;\;x + y\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.5000000000000002e-15 or 3.19999999999999975e82 < z

    1. Initial program 99.9%

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

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

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

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

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative78.9%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified78.9%

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

    if -5.5000000000000002e-15 < z < 1.0999999999999999e-19

    1. Initial program 97.7%

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

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

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

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

      \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
    6. Step-by-step derivation
      1. +-commutative75.8%

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    7. Simplified78.4%

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

    if 1.0999999999999999e-19 < z < 3.19999999999999975e82

    1. Initial program 99.9%

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

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

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

        \[\leadsto x + \frac{\color{blue}{-t \cdot y}}{z - a} \]
      3. distribute-lft-neg-out80.6%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{-t}{z - a}} \]
      7. /-rgt-identity89.2%

        \[\leadsto x + \color{blue}{y} \cdot \frac{-t}{z - a} \]
      8. distribute-neg-frac89.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{z}} \]
    7. Step-by-step derivation
      1. mul-1-neg80.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{-15}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-19}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+82}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 76.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-15} \lor \neg \left(z \leq 1.9 \cdot 10^{+79}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.0000000000000003e-15 or 1.9000000000000001e79 < z

    1. Initial program 99.9%

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

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

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

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

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative78.2%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified78.2%

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

    if -4.0000000000000003e-15 < z < 1.9000000000000001e79

    1. Initial program 98.0%

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

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

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

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

      \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
    6. Step-by-step derivation
      1. +-commutative72.6%

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    7. Simplified75.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{-15} \lor \neg \left(z \leq 1.9 \cdot 10^{+79}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 76.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-16} \lor \neg \left(z \leq 1.9 \cdot 10^{+79}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.5000000000000001e-16 or 1.9000000000000001e79 < z

    1. Initial program 99.9%

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

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

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

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

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative78.2%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified78.2%

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

    if -8.5000000000000001e-16 < z < 1.9000000000000001e79

    1. Initial program 98.0%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num98.0%

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{z - a}{z - t}}} \]
      2. un-div-inv98.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{-16} \lor \neg \left(z \leq 1.9 \cdot 10^{+79}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 76.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-16} \lor \neg \left(z \leq 7.6 \cdot 10^{+79}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.0000000000000003e-16 or 7.6000000000000005e79 < z

    1. Initial program 99.9%

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

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

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

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

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative78.2%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified78.2%

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

    if -9.0000000000000003e-16 < z < 7.6000000000000005e79

    1. Initial program 98.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{-16} \lor \neg \left(z \leq 7.6 \cdot 10^{+79}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 59.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{+71} \lor \neg \left(y \leq 6.8 \cdot 10^{+221}\right):\\
\;\;\;\;y \cdot \frac{t}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.2000000000000004e71 or 6.7999999999999997e221 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
    10. Simplified83.1%

      \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
    11. Taylor expanded in t around inf 39.2%

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

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

        \[\leadsto x + \frac{\color{blue}{-t \cdot y}}{z - a} \]
      3. distribute-lft-neg-out51.7%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{-t}{z - a}} \]
      7. /-rgt-identity67.1%

        \[\leadsto x + \color{blue}{y} \cdot \frac{-t}{z - a} \]
      8. distribute-neg-frac67.1%

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

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

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

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

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

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

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

        \[\leadsto x + y \cdot \frac{t}{\color{blue}{a} - z} \]
    13. Simplified51.4%

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

    if -8.2000000000000004e71 < y < 6.7999999999999997e221

    1. Initial program 98.5%

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

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

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

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

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative70.3%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified70.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.2 \cdot 10^{+71} \lor \neg \left(y \leq 6.8 \cdot 10^{+221}\right):\\ \;\;\;\;y \cdot \frac{t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 60.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq 1.7 \cdot 10^{+207}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.20000000000000005e72

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
    10. Simplified79.8%

      \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
    11. Taylor expanded in t around inf 36.2%

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

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

        \[\leadsto x + \frac{\color{blue}{-t \cdot y}}{z - a} \]
      3. distribute-lft-neg-out50.3%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{-t}{z - a}} \]
      7. /-rgt-identity68.7%

        \[\leadsto x + \color{blue}{y} \cdot \frac{-t}{z - a} \]
      8. distribute-neg-frac68.7%

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

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

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

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

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

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

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

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

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

    if -1.20000000000000005e72 < y < 1.6999999999999999e207

    1. Initial program 98.5%

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

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

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

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

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative71.0%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified71.0%

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

    if 1.6999999999999999e207 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
    10. Simplified82.2%

      \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
    11. Taylor expanded in a around 0 61.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+72}:\\ \;\;\;\;y \cdot \frac{t}{a - z}\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+207}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 63.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.8 \cdot 10^{+46}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 3.7 \cdot 10^{+98}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.7999999999999996e46 or 3.6999999999999999e98 < a

    1. Initial program 98.9%

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

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

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

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

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

    if -6.7999999999999996e46 < a < 3.6999999999999999e98

    1. Initial program 98.8%

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

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

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

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

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative65.7%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified65.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.8 \cdot 10^{+46}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 3.7 \cdot 10^{+98}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 52.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{-270}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-145}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= x -6.2e-270) x (if (<= x 1.2e-145) y x)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (x <= -6.2e-270) {
		tmp = x;
	} else if (x <= 1.2e-145) {
		tmp = y;
	} else {
		tmp = x;
	}
	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 (x <= (-6.2d-270)) then
        tmp = x
    else if (x <= 1.2d-145) then
        tmp = y
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (x <= -6.2e-270) {
		tmp = x;
	} else if (x <= 1.2e-145) {
		tmp = y;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if x <= -6.2e-270:
		tmp = x
	elif x <= 1.2e-145:
		tmp = y
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (x <= -6.2e-270)
		tmp = x;
	elseif (x <= 1.2e-145)
		tmp = y;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (x <= -6.2e-270)
		tmp = x;
	elseif (x <= 1.2e-145)
		tmp = y;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -6.2e-270], x, If[LessEqual[x, 1.2e-145], y, x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{-270}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.2 \cdot 10^{-145}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.2e-270 or 1.20000000000000008e-145 < x

    1. Initial program 99.0%

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

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

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

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

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

    if -6.2e-270 < x < 1.20000000000000008e-145

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
    10. Simplified91.9%

      \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
    11. Taylor expanded in z around inf 36.0%

      \[\leadsto \color{blue}{y} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 16: 98.0% accurate, 1.0× speedup?

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

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

    \[x + y \cdot \frac{z - t}{z - a} \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 17: 50.8% 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 98.8%

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Add Preprocessing

Developer Target 1: 98.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{y}{\frac{z - a}{z - t}} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
	return x + (y / ((z - a) / (z - 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 - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a):
	return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a)
	return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t))))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (y / ((z - a) / (z - t)));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Reproduce

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

  :alt
  (! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))

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