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

Percentage Accurate: 76.6% → 89.5%
Time: 12.8s
Alternatives: 14
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 14 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: 76.6% 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: 89.5% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 82.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z - t, \frac{y}{-\color{blue}{\left(a + \left(-t\right)\right)}}, x + y\right) \]
      10. distribute-neg-in91.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-neg91.5%

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

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

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

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

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

    1. Initial program 3.8%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 88.7% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-238}:\\
\;\;\;\;t\_2\\

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

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

\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))) < -inf.0 or 9.9999999999999992e292 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t)))

    1. Initial program 41.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z - t, \frac{y}{-\color{blue}{\left(a + \left(-t\right)\right)}}, x + y\right) \]
      10. distribute-neg-in80.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-neg80.2%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z - t, \frac{y}{t - a}, x + y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num80.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{-1 \cdot x + -1 \cdot \left(y + \frac{y \cdot \left(z - t\right)}{t - a}\right)}{x}} \]
    13. Step-by-step derivation
      1. distribute-lft-out41.2%

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

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

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

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

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

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

    if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -2e-238 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 9.9999999999999992e292

    1. Initial program 98.5%

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

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

    1. Initial program 3.8%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 88.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+89}:\\
\;\;\;\;y \cdot \frac{z}{t} - \left(a \cdot \frac{y}{t} - x\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.5e89

    1. Initial program 62.0%

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

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

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

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

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

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

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

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

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

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

    if -4.5e89 < t < 1.01999999999999996e86

    1. Initial program 88.2%

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

    if 1.01999999999999996e86 < t

    1. Initial program 52.6%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 81.1% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.00000000000000023e-59 or 5.6e7 < t

    1. Initial program 64.1%

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

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

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

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

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

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

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

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

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

    if -9.00000000000000023e-59 < t < 5.6e7

    1. Initial program 93.1%

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

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

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

Alternative 5: 78.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{+28} \lor \neg \left(a \leq 8.8 \cdot 10^{-13}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.2000000000000001e28 or 8.79999999999999986e-13 < a

    1. Initial program 79.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z - t, \frac{y}{-\color{blue}{\left(a + \left(-t\right)\right)}}, x + y\right) \]
      10. distribute-neg-in95.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-neg95.1%

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

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

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

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

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

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

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

    if -6.2000000000000001e28 < a < 8.79999999999999986e-13

    1. Initial program 74.8%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 81.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{-59}:\\
\;\;\;\;y \cdot \frac{z}{t} - \left(a \cdot \frac{y}{t} - x\right)\\

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

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


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

    1. Initial program 68.6%

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

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

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

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

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

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

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

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

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

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

    if -8.1999999999999991e-59 < t < 2.5e6

    1. Initial program 93.1%

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

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

    if 2.5e6 < t

    1. Initial program 58.0%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 75.3% accurate, 0.8× speedup?

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

    1. Initial program 78.6%

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

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

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

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

        \[\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.0%

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

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

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

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

        \[\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.0%

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

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

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

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

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

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

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

    if -3.0000000000000002e-36 < a < 7.0000000000000006e-64

    1. Initial program 75.2%

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

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

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

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

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

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

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

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

Alternative 8: 61.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{+103} \lor \neg \left(y \leq 5.2 \cdot 10^{+203}\right):\\
\;\;\;\;z \cdot \frac{y}{t - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.39999999999999985e103 or 5.1999999999999997e203 < y

    1. Initial program 48.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 41.8%

      \[\leadsto \color{blue}{\frac{y \cdot z}{t - a}} \]
    6. Step-by-step derivation
      1. *-commutative41.8%

        \[\leadsto \frac{\color{blue}{z \cdot y}}{t - a} \]
      2. *-lft-identity41.8%

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

        \[\leadsto \color{blue}{\frac{z}{1} \cdot \frac{y}{t - a}} \]
      4. /-rgt-identity54.9%

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

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

    if -6.39999999999999985e103 < y < 5.1999999999999997e203

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

        \[\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.0%

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

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

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

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

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

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

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

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

Alternative 9: 61.8% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5e103 or 1.11999999999999996e204 < y

    1. Initial program 48.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 41.8%

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

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

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

    if -5e103 < y < 1.11999999999999996e204

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

        \[\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.0%

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

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

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

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

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

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

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

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

Alternative 10: 53.8% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x \leq 9.2 \cdot 10^{-119}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.50000000000000009e-118 or 9.19999999999999973e-119 < x

    1. Initial program 78.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z - t, \frac{y}{-\color{blue}{\left(a + \left(-t\right)\right)}}, x + y\right) \]
      10. distribute-neg-in88.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-neg88.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(y + -1 \cdot y\right)} \]
    10. Step-by-step derivation
      1. distribute-rgt1-in67.1%

        \[\leadsto x + \color{blue}{\left(-1 + 1\right) \cdot y} \]
      2. metadata-eval67.1%

        \[\leadsto x + \color{blue}{0} \cdot y \]
      3. mul0-lft67.1%

        \[\leadsto x + \color{blue}{0} \]
      4. +-rgt-identity67.1%

        \[\leadsto \color{blue}{x} \]
    11. Simplified67.1%

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

    if -1.50000000000000009e-118 < x < 9.19999999999999973e-119

    1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y + x} \]
    8. Taylor expanded in y around inf 36.5%

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

Alternative 11: 60.2% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 5.50000000000000029e203

    1. Initial program 78.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z - t, \frac{y}{-\color{blue}{\left(a + \left(-t\right)\right)}}, x + y\right) \]
      10. distribute-neg-in87.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-neg87.5%

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

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

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

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

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

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

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

    if 5.50000000000000029e203 < y

    1. Initial program 52.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z - t, \frac{y}{-\color{blue}{\left(a + \left(-t\right)\right)}}, x + y\right) \]
      10. distribute-neg-in65.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-neg65.7%

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

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

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

      \[\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 58.1%

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

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

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

        \[\leadsto \color{blue}{\frac{z}{1} \cdot \frac{y}{t - a}} \]
      4. /-rgt-identity69.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 5.5 \cdot 10^{+203}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 60.3% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 7.00000000000000062e203

    1. Initial program 78.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z - t, \frac{y}{-\color{blue}{\left(a + \left(-t\right)\right)}}, x + y\right) \]
      10. distribute-neg-in87.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-neg87.5%

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

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

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

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

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

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

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

    if 7.00000000000000062e203 < y

    1. Initial program 52.6%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 7 \cdot 10^{+203}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 61.7% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.8 \cdot 10^{+100}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 4.80000000000000023e100

    1. Initial program 82.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.80000000000000023e100 < t

    1. Initial program 53.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z - t, \frac{y}{-\color{blue}{\left(a + \left(-t\right)\right)}}, x + y\right) \]
      10. distribute-neg-in70.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-neg70.2%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z - t, \frac{y}{t - a}, x + y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num70.2%

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

        \[\leadsto \mathsf{fma}\left(z - t, \color{blue}{{\left(\frac{t - a}{y}\right)}^{-1}}, x + y\right) \]
    6. Applied egg-rr70.2%

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

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

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

      \[\leadsto \color{blue}{x + \left(y + -1 \cdot y\right)} \]
    10. Step-by-step derivation
      1. distribute-rgt1-in72.8%

        \[\leadsto x + \color{blue}{\left(-1 + 1\right) \cdot y} \]
      2. metadata-eval72.8%

        \[\leadsto x + \color{blue}{0} \cdot y \]
      3. mul0-lft72.8%

        \[\leadsto x + \color{blue}{0} \]
      4. +-rgt-identity72.8%

        \[\leadsto \color{blue}{x} \]
    11. Simplified72.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 4.8 \cdot 10^{+100}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 51.1% 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 77.1%

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(z - t, \frac{y}{-\color{blue}{\left(a + \left(-t\right)\right)}}, x + y\right) \]
    10. distribute-neg-in86.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-neg86.1%

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(z - t, \frac{y}{t - a}, x + y\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. clear-num85.7%

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

      \[\leadsto \mathsf{fma}\left(z - t, \color{blue}{{\left(\frac{t - a}{y}\right)}^{-1}}, x + y\right) \]
  6. Applied egg-rr85.7%

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

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

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

    \[\leadsto \color{blue}{x + \left(y + -1 \cdot y\right)} \]
  10. Step-by-step derivation
    1. distribute-rgt1-in55.2%

      \[\leadsto x + \color{blue}{\left(-1 + 1\right) \cdot y} \]
    2. metadata-eval55.2%

      \[\leadsto x + \color{blue}{0} \cdot y \]
    3. mul0-lft55.2%

      \[\leadsto x + \color{blue}{0} \]
    4. +-rgt-identity55.2%

      \[\leadsto \color{blue}{x} \]
  11. Simplified55.2%

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

Developer Target 1: 87.7% 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 2024132 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -13664970889390727/100000000000000000000000) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 14754293444577233/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y)))))

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