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

Percentage Accurate: 77.7% → 90.9%
Time: 10.4s
Alternatives: 11
Speedup: 0.7×

Specification

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

\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{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 11 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: 77.7% accurate, 1.0× speedup?

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

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

Alternative 1: 90.9% accurate, 0.1× speedup?

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

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

\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-236} \lor \neg \left(t\_1 \leq 0\right) \land t\_1 \leq 10^{+283}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 38.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -1e-236 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 9.99999999999999955e282

    1. Initial program 98.5%

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

    if -1e-236 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0 or 9.99999999999999955e282 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t)))

    1. Initial program 36.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z - t, \frac{y}{\color{blue}{\left(-a\right) + \left(-\left(-t\right)\right)}}, x + y\right) \]
      11. remove-double-neg45.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.6% accurate, 0.1× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 0 \lor \neg \left(t\_1 \leq 10^{+283}\right):\\
\;\;\;\;x + y \cdot \left(\frac{z}{t} - \frac{a}{t}\right)\\

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


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

    1. Initial program 84.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z - t, \frac{y}{\color{blue}{\left(-a\right) + \left(-\left(-t\right)\right)}}, x + y\right) \]
      11. remove-double-neg92.2%

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

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

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

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

    if -1e-236 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0 or 9.99999999999999955e282 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t)))

    1. Initial program 36.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z - t, \frac{y}{\color{blue}{\left(-a\right) + \left(-\left(-t\right)\right)}}, x + y\right) \]
      11. remove-double-neg45.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 97.7%

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

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

Alternative 3: 89.6% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 0 \lor \neg \left(t\_1 \leq 10^{+283}\right):\\
\;\;\;\;x + y \cdot \left(\frac{z}{t} - \frac{a}{t}\right)\\

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


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

    1. Initial program 84.5%

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l*92.0%

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

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

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

    if -1e-236 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0 or 9.99999999999999955e282 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t)))

    1. Initial program 36.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z - t, \frac{y}{\color{blue}{\left(-a\right) + \left(-\left(-t\right)\right)}}, x + y\right) \]
      11. remove-double-neg45.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 97.7%

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

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

Alternative 4: 89.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+92} \lor \neg \left(t \leq 1.4 \cdot 10^{+198}\right):\\
\;\;\;\;x + y \cdot \left(\frac{z}{t} - \frac{a}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1e92 or 1.4e198 < t

    1. Initial program 50.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e92 < t < 1.4e198

    1. Initial program 89.8%

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l*92.1%

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

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

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

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

Alternative 5: 63.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+201} \lor \neg \left(z \leq -1.3 \cdot 10^{+177}\right) \land z \leq 6.2 \cdot 10^{+107}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.7e201 or -1.2999999999999999e177 < z < 6.20000000000000052e107

    1. Initial program 78.9%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative67.4%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified67.4%

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

    if -2.7e201 < z < -1.2999999999999999e177 or 6.20000000000000052e107 < z

    1. Initial program 75.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 76.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.2 \cdot 10^{-36} \lor \neg \left(a \leq 1.7 \cdot 10^{+57}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.2e-36 or 1.69999999999999996e57 < a

    1. Initial program 81.4%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative79.4%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified79.4%

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

    if -1.2e-36 < a < 1.69999999999999996e57

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z - t, \frac{y}{\color{blue}{\left(-a\right) + \left(-\left(-t\right)\right)}}, x + y\right) \]
      11. remove-double-neg76.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 77.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{-36} \lor \neg \left(a \leq 4.9 \cdot 10^{+57}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.6e-36 or 4.8999999999999999e57 < a

    1. Initial program 81.4%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative79.4%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified79.4%

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

    if -2.6e-36 < a < 4.8999999999999999e57

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z - t, \frac{y}{\color{blue}{\left(-a\right) + \left(-\left(-t\right)\right)}}, x + y\right) \]
      11. remove-double-neg76.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{1}{\frac{t}{y \cdot z}}} \]
      2. inv-pow73.0%

        \[\leadsto x + \color{blue}{{\left(\frac{t}{y \cdot z}\right)}^{-1}} \]
    10. Applied egg-rr73.0%

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

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

        \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{t}{y}}{z}}} \]
    12. Simplified79.0%

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

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

Alternative 8: 82.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{-70} \lor \neg \left(a \leq 2.1 \cdot 10^{-40}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -9.4999999999999994e-70 or 2.10000000000000018e-40 < a

    1. Initial program 81.0%

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

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

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

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

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

    if -9.4999999999999994e-70 < a < 2.10000000000000018e-40

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{1}{\frac{t}{y \cdot z}}} \]
      2. inv-pow73.7%

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

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

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

        \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{t}{y}}{z}}} \]
    12. Simplified81.2%

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

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

Alternative 9: 76.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.2 \cdot 10^{-36} \lor \neg \left(a \leq 5.9 \cdot 10^{+57}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.1999999999999999e-36 or 5.90000000000000013e57 < a

    1. Initial program 81.4%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative79.4%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified79.4%

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

    if -2.1999999999999999e-36 < a < 5.90000000000000013e57

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z - t, \frac{y}{\color{blue}{\left(-a\right) + \left(-\left(-t\right)\right)}}, x + y\right) \]
      11. remove-double-neg76.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 61.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+102}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.99999999999999995e102 or 3.8000000000000001e-35 < t

    1. Initial program 61.2%

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

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

    if -1.99999999999999995e102 < t < 3.8000000000000001e-35

    1. Initial program 91.8%

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

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

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified62.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2 \cdot 10^{+102}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-35}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 50.7% 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 78.3%

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification55.9%

    \[\leadsto x \]
  5. Add Preprocessing

Developer target: 88.3% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

  :alt
  (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-7) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))

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