Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3

Percentage Accurate: 67.4% → 90.8%
Time: 12.1s
Alternatives: 16
Speedup: 0.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 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: 67.4% accurate, 1.0× speedup?

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

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

Alternative 1: 90.8% accurate, 0.1× speedup?

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

\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-260} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -3.99999999999999985e-260 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t)))

    1. Initial program 71.5%

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

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

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

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

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

    if -3.99999999999999985e-260 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0

    1. Initial program 4.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y + \left(-\color{blue}{x \cdot \frac{-1 \cdot z - -1 \cdot a}{t}}\right) \]
      16. distribute-lft-out--99.5%

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

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

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

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

Alternative 2: 88.6% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-260}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;y + x \cdot \frac{z - a}{t}\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+287}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1.9999999999999998e250 or 5e287 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t)))

    1. Initial program 42.2%

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot \left(1 - \frac{x}{y}\right)}, \frac{z - t}{a - t}, x\right) \]
    8. Step-by-step derivation
      1. fma-undefine81.5%

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

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

    if -1.9999999999999998e250 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -3.99999999999999985e-260 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 5e287

    1. Initial program 96.1%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing

    if -3.99999999999999985e-260 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0

    1. Initial program 4.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y + \left(-\color{blue}{x \cdot \frac{-1 \cdot z - -1 \cdot a}{t}}\right) \]
      16. distribute-lft-out--99.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq -2 \cdot 10^{+250}:\\ \;\;\;\;x + \left(y \cdot \left(1 - \frac{x}{y}\right)\right) \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq -4 \cdot 10^{-260}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq 0:\\ \;\;\;\;y + x \cdot \frac{z - a}{t}\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq 5 \cdot 10^{+287}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y \cdot \left(1 - \frac{x}{y}\right)\right) \cdot \frac{z - t}{a - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 82.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \frac{z - t}{a - t}\\ t_2 := \left(y - x\right) \cdot \left(z - t\right)\\ t_3 := x + \frac{t\_2}{a - t}\\ \mathbf{if}\;t\_3 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_3 \leq -4 \cdot 10^{-260}:\\ \;\;\;\;x + \frac{1}{\frac{a - t}{t\_2}}\\ \mathbf{elif}\;t\_3 \leq 0:\\ \;\;\;\;y + x \cdot \frac{z - a}{t}\\ \mathbf{elif}\;t\_3 \leq 10^{+256}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* y (/ (- z t) (- a t)))))
        (t_2 (* (- y x) (- z t)))
        (t_3 (+ x (/ t_2 (- a t)))))
   (if (<= t_3 (- INFINITY))
     t_1
     (if (<= t_3 -4e-260)
       (+ x (/ 1.0 (/ (- a t) t_2)))
       (if (<= t_3 0.0)
         (+ y (* x (/ (- z a) t)))
         (if (<= t_3 1e+256) t_3 t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * ((z - t) / (a - t)));
	double t_2 = (y - x) * (z - t);
	double t_3 = x + (t_2 / (a - t));
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_3 <= -4e-260) {
		tmp = x + (1.0 / ((a - t) / t_2));
	} else if (t_3 <= 0.0) {
		tmp = y + (x * ((z - a) / t));
	} else if (t_3 <= 1e+256) {
		tmp = t_3;
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * ((z - t) / (a - t)));
	double t_2 = (y - x) * (z - t);
	double t_3 = x + (t_2 / (a - t));
	double tmp;
	if (t_3 <= -Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else if (t_3 <= -4e-260) {
		tmp = x + (1.0 / ((a - t) / t_2));
	} else if (t_3 <= 0.0) {
		tmp = y + (x * ((z - a) / t));
	} else if (t_3 <= 1e+256) {
		tmp = t_3;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y * ((z - t) / (a - t)))
	t_2 = (y - x) * (z - t)
	t_3 = x + (t_2 / (a - t))
	tmp = 0
	if t_3 <= -math.inf:
		tmp = t_1
	elif t_3 <= -4e-260:
		tmp = x + (1.0 / ((a - t) / t_2))
	elif t_3 <= 0.0:
		tmp = y + (x * ((z - a) / t))
	elif t_3 <= 1e+256:
		tmp = t_3
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t))))
	t_2 = Float64(Float64(y - x) * Float64(z - t))
	t_3 = Float64(x + Float64(t_2 / Float64(a - t)))
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_3 <= -4e-260)
		tmp = Float64(x + Float64(1.0 / Float64(Float64(a - t) / t_2)));
	elseif (t_3 <= 0.0)
		tmp = Float64(y + Float64(x * Float64(Float64(z - a) / t)));
	elseif (t_3 <= 1e+256)
		tmp = t_3;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y * ((z - t) / (a - t)));
	t_2 = (y - x) * (z - t);
	t_3 = x + (t_2 / (a - t));
	tmp = 0.0;
	if (t_3 <= -Inf)
		tmp = t_1;
	elseif (t_3 <= -4e-260)
		tmp = x + (1.0 / ((a - t) / t_2));
	elseif (t_3 <= 0.0)
		tmp = y + (x * ((z - a) / t));
	elseif (t_3 <= 1e+256)
		tmp = t_3;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(t$95$2 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$1, If[LessEqual[t$95$3, -4e-260], N[(x + N[(1.0 / N[(N[(a - t), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[(y + N[(x * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e+256], t$95$3, t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
t_2 := \left(y - x\right) \cdot \left(z - t\right)\\
t_3 := x + \frac{t\_2}{a - t}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_3 \leq -4 \cdot 10^{-260}:\\
\;\;\;\;x + \frac{1}{\frac{a - t}{t\_2}}\\

\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;y + x \cdot \frac{z - a}{t}\\

\mathbf{elif}\;t\_3 \leq 10^{+256}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -inf.0 or 1e256 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t)))

    1. Initial program 39.5%

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

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

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

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

    if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -3.99999999999999985e-260

    1. Initial program 94.7%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num94.7%

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

        \[\leadsto x + \color{blue}{{\left(\frac{a - t}{\left(y - x\right) \cdot \left(z - t\right)}\right)}^{-1}} \]
    4. Applied egg-rr94.7%

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

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

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

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

    if -3.99999999999999985e-260 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0

    1. Initial program 4.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y + \left(-\color{blue}{x \cdot \frac{-1 \cdot z - -1 \cdot a}{t}}\right) \]
      16. distribute-lft-out--99.5%

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

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

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

    if 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 1e256

    1. Initial program 98.2%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
  3. Recombined 4 regimes into one program.
  4. Final simplification85.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq -\infty:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq -4 \cdot 10^{-260}:\\ \;\;\;\;x + \frac{1}{\frac{a - t}{\left(y - x\right) \cdot \left(z - t\right)}}\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq 0:\\ \;\;\;\;y + x \cdot \frac{z - a}{t}\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq 10^{+256}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 82.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \frac{z - t}{a - t}\\ t_2 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-260}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;y + x \cdot \frac{z - a}{t}\\ \mathbf{elif}\;t\_2 \leq 10^{+256}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* y (/ (- z t) (- a t)))))
        (t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
   (if (<= t_2 (- INFINITY))
     t_1
     (if (<= t_2 -4e-260)
       t_2
       (if (<= t_2 0.0)
         (+ y (* x (/ (- z a) t)))
         (if (<= t_2 1e+256) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * ((z - t) / (a - t)));
	double t_2 = x + (((y - x) * (z - t)) / (a - t));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_2 <= -4e-260) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = y + (x * ((z - a) / t));
	} else if (t_2 <= 1e+256) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * ((z - t) / (a - t)));
	double t_2 = x + (((y - x) * (z - t)) / (a - t));
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else if (t_2 <= -4e-260) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = y + (x * ((z - a) / t));
	} else if (t_2 <= 1e+256) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y * ((z - t) / (a - t)))
	t_2 = x + (((y - x) * (z - t)) / (a - t))
	tmp = 0
	if t_2 <= -math.inf:
		tmp = t_1
	elif t_2 <= -4e-260:
		tmp = t_2
	elif t_2 <= 0.0:
		tmp = y + (x * ((z - a) / t))
	elif t_2 <= 1e+256:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t))))
	t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t)))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_2 <= -4e-260)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = Float64(y + Float64(x * Float64(Float64(z - a) / t)));
	elseif (t_2 <= 1e+256)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y * ((z - t) / (a - t)));
	t_2 = x + (((y - x) * (z - t)) / (a - t));
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = t_1;
	elseif (t_2 <= -4e-260)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = y + (x * ((z - a) / t));
	elseif (t_2 <= 1e+256)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -4e-260], t$95$2, If[LessEqual[t$95$2, 0.0], N[(y + N[(x * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+256], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-260}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;y + x \cdot \frac{z - a}{t}\\

\mathbf{elif}\;t\_2 \leq 10^{+256}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -inf.0 or 1e256 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t)))

    1. Initial program 39.5%

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

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

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

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

    if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -3.99999999999999985e-260 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 1e256

    1. Initial program 96.2%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing

    if -3.99999999999999985e-260 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0

    1. Initial program 4.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y + \left(-\color{blue}{x \cdot \frac{-1 \cdot z - -1 \cdot a}{t}}\right) \]
      16. distribute-lft-out--99.5%

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

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

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

Alternative 5: 71.5% accurate, 0.4× speedup?

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

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

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

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

\mathbf{elif}\;y \leq 2.1 \cdot 10^{-49}:\\
\;\;\;\;x + z \cdot \frac{y - x}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -8.80000000000000035e-61 or 2.0999999999999999e-49 < y

    1. Initial program 65.2%

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

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

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

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

    if -8.80000000000000035e-61 < y < 1.37999999999999995e-124

    1. Initial program 70.8%

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

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

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

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

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

        \[\leadsto x + x \cdot \color{blue}{\left(-1 \cdot \frac{z - t}{a - t}\right)} \]
      5. associate-*r/70.2%

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

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

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

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

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

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

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

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

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

    if 1.37999999999999995e-124 < y < 8.4000000000000004e-75

    1. Initial program 63.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y - \left(z \cdot \frac{y - x}{t} - \color{blue}{a \cdot \frac{y - x}{t}}\right) \]
      9. distribute-rgt-out--87.6%

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

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

    if 8.4000000000000004e-75 < y < 2.0999999999999999e-49

    1. Initial program 100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.8 \cdot 10^{-61}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;y \leq 1.38 \cdot 10^{-124}:\\ \;\;\;\;x + x \cdot \frac{z - t}{t - a}\\ \mathbf{elif}\;y \leq 8.4 \cdot 10^{-75}:\\ \;\;\;\;y + \left(z - a\right) \cdot \frac{x - y}{t}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-49}:\\ \;\;\;\;x + z \cdot \frac{y - x}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 75.7% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y \leq 2.5 \cdot 10^{-217}:\\
\;\;\;\;x \cdot \left(\left(1 + \frac{t}{a - t}\right) + \frac{z}{t - a}\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.99999999999999977e-58 or 1.11999999999999999e-48 < y

    1. Initial program 65.2%

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

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

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

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

    if -4.99999999999999977e-58 < y < 2.5000000000000001e-217

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

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

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

    if 2.5000000000000001e-217 < y < 1.11999999999999999e-48

    1. Initial program 76.8%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
  3. Recombined 3 regimes into one program.
  4. Final simplification83.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{-58}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-217}:\\ \;\;\;\;x \cdot \left(\left(1 + \frac{t}{a - t}\right) + \frac{z}{t - a}\right)\\ \mathbf{elif}\;y \leq 1.12 \cdot 10^{-48}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 35.6% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq -1.75 \cdot 10^{-227}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq -4.3 \cdot 10^{-303}:\\
\;\;\;\;y\\

\mathbf{elif}\;z \leq 2.3 \cdot 10^{+47}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.49999999999999996e72 or 2.2999999999999999e47 < z

    1. Initial program 66.8%

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot \left(1 + -1 \cdot \frac{x}{y}\right)}, \frac{z - t}{a - t}, x\right) \]
    6. Step-by-step derivation
      1. mul-1-neg81.7%

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

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

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

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

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

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

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

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

    if -2.49999999999999996e72 < z < -1.75000000000000005e-227 or -4.29999999999999981e-303 < z < 2.2999999999999999e47

    1. Initial program 72.2%

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

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

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

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

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

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

    if -1.75000000000000005e-227 < z < -4.29999999999999981e-303

    1. Initial program 38.4%

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

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

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

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

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

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

Alternative 8: 36.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \frac{z}{t}\\
\mathbf{if}\;a \leq -1.02 \cdot 10^{-29}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.2 \cdot 10^{-170}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.65 \cdot 10^{+22}:\\
\;\;\;\;y\\

\mathbf{elif}\;a \leq 1.45 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.01999999999999994e-29 or 1.45000000000000001e32 < a

    1. Initial program 67.0%

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

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

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

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

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

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

    if -1.01999999999999994e-29 < a < 1.2e-170 or 1.6499999999999999e22 < a < 1.45000000000000001e32

    1. Initial program 68.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{y \cdot \frac{z \cdot \left(1 - \frac{x}{y}\right)}{t}} \]
      3. distribute-rgt-neg-in36.4%

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{z}{t}} \]
    14. Simplified39.7%

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

    if 1.2e-170 < a < 1.6499999999999999e22

    1. Initial program 69.0%

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

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

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

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

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

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

Alternative 9: 71.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{-60} \lor \neg \left(y \leq 1.12 \cdot 10^{-95}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{a - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.6499999999999999e-60 or 1.12000000000000006e-95 < y

    1. Initial program 65.7%

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

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

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

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

    if -1.6499999999999999e-60 < y < 1.12000000000000006e-95

    1. Initial program 70.8%

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

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

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

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

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

        \[\leadsto x + x \cdot \color{blue}{\left(-1 \cdot \frac{z - t}{a - t}\right)} \]
      5. associate-*r/69.2%

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

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

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

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

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

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

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

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

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

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

Alternative 10: 68.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-23} \lor \neg \left(t \leq 1.7 \cdot 10^{+86}\right):\\
\;\;\;\;y + x \cdot \frac{z - a}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.99999999999999992e-23 or 1.6999999999999999e86 < t

    1. Initial program 39.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y + \left(-\color{blue}{x \cdot \frac{-1 \cdot z - -1 \cdot a}{t}}\right) \]
      16. distribute-lft-out--65.2%

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

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

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

    if -1.99999999999999992e-23 < t < 1.6999999999999999e86

    1. Initial program 88.1%

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

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

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

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

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

Alternative 11: 65.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.6 \cdot 10^{+64} \lor \neg \left(t \leq 1.96 \cdot 10^{-44}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\

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


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

    1. Initial program 45.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.60000000000000047e64 < t < 1.9599999999999999e-44

    1. Initial program 86.0%

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

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

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

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

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

Alternative 12: 69.3% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.3999999999999999e-23

    1. Initial program 45.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y + \left(-\color{blue}{x \cdot \frac{-1 \cdot z - -1 \cdot a}{t}}\right) \]
      16. distribute-lft-out--61.9%

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

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

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

    if -1.3999999999999999e-23 < t < 1.2999999999999999e-44

    1. Initial program 90.4%

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

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

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

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

    if 1.2999999999999999e-44 < t

    1. Initial program 47.1%

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

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

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

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

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

      \[\leadsto \color{blue}{y + -1 \cdot \frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}} \]
    6. Taylor expanded in z around inf 56.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 52.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -19000000000000:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.9e13

    1. Initial program 59.9%

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

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

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

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

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

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

    if -1.9e13 < x < 1.5499999999999999e25

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5499999999999999e25 < x

    1. Initial program 57.9%

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot \left(1 + -1 \cdot \frac{x}{y}\right)}, \frac{z - t}{a - t}, x\right) \]
    6. Step-by-step derivation
      1. mul-1-neg60.9%

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

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

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

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

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

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

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

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

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

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

Alternative 14: 31.3% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;x \leq 4.8 \cdot 10^{-72}:\\
\;\;\;\;z \cdot \frac{y}{a - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -8.5999999999999995e-51

    1. Initial program 60.0%

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

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

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

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

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

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

    if -8.5999999999999995e-51 < x < 4.8e-72

    1. Initial program 78.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{a - t}} \]
    10. Step-by-step derivation
      1. *-commutative37.9%

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{a - t}} \]
    11. Simplified42.3%

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

    if 4.8e-72 < x

    1. Initial program 59.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 37.8% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{-62}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 3.15 \cdot 10^{+47}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.90000000000000003e-62 or 3.15000000000000002e47 < a

    1. Initial program 67.9%

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

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

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

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

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

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

    if -1.90000000000000003e-62 < a < 3.15000000000000002e47

    1. Initial program 67.2%

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

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

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

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

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

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

Alternative 16: 24.8% accurate, 13.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 67.6%

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

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

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

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

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

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

Developer target: 86.6% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;a < 3.774403170083174 \cdot 10^{-182}:\\
\;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024111 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
  :precision binary64

  :alt
  (if (< a -1.6153062845442575e-142) (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t)))) (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t))))))

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