Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A

Percentage Accurate: 99.8% → 99.8%
Time: 12.6s
Alternatives: 23
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b):
	return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\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 23 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: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b):
	return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 99.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(a + -0.5, b, \left(y + \left(x + z\right)\right) - z \cdot \log t\right) \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (fma (+ a -0.5) b (- (+ y (+ x z)) (* z (log t)))))
double code(double x, double y, double z, double t, double a, double b) {
	return fma((a + -0.5), b, ((y + (x + z)) - (z * log(t))));
}
function code(x, y, z, t, a, b)
	return fma(Float64(a + -0.5), b, Float64(Float64(y + Float64(x + z)) - Float64(z * log(t))))
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(a + -0.5), $MachinePrecision] * b + N[(N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(a + -0.5, b, \left(y + \left(x + z\right)\right) - z \cdot \log t\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Step-by-step derivation
    1. +-commutative99.9%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right)} \]
    2. fma-def99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, \left(\left(x + y\right) + z\right) - z \cdot \log t\right)} \]
    3. sub-neg99.9%

      \[\leadsto \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, \left(\left(x + y\right) + z\right) - z \cdot \log t\right) \]
    4. metadata-eval99.9%

      \[\leadsto \mathsf{fma}\left(a + \color{blue}{-0.5}, b, \left(\left(x + y\right) + z\right) - z \cdot \log t\right) \]
    5. +-commutative99.9%

      \[\leadsto \mathsf{fma}\left(a + -0.5, b, \left(\color{blue}{\left(y + x\right)} + z\right) - z \cdot \log t\right) \]
    6. associate-+l+99.9%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(a + -0.5, b, \left(y + \left(x + z\right)\right) - z \cdot \log t\right)} \]
  4. Final simplification99.9%

    \[\leadsto \mathsf{fma}\left(a + -0.5, b, \left(y + \left(x + z\right)\right) - z \cdot \log t\right) \]

Alternative 2: 90.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+79}:\\
\;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\

\mathbf{elif}\;t_1 \leq 10^{+46}:\\
\;\;\;\;\left(y + x\right) + z \cdot \left(1 - \log t\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a + -0.5, b, y + x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 a 1/2) b) < -1.99999999999999993e79

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in z around 0 87.5%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(y + x\right)} \]
    5. Taylor expanded in a around 0 87.5%

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

    if -1.99999999999999993e79 < (*.f64 (-.f64 a 1/2) b) < 9.9999999999999999e45

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.8%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative99.8%

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.8%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.8%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.8%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.8%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.8%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in b around 0 93.0%

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

    if 9.9999999999999999e45 < (*.f64 (-.f64 a 1/2) b)

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right)} \]
      2. fma-def100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, \left(\left(x + y\right) + z\right) - z \cdot \log t\right)} \]
      3. sub-neg100.0%

        \[\leadsto \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, \left(\left(x + y\right) + z\right) - z \cdot \log t\right) \]
      4. metadata-eval100.0%

        \[\leadsto \mathsf{fma}\left(a + \color{blue}{-0.5}, b, \left(\left(x + y\right) + z\right) - z \cdot \log t\right) \]
      5. +-commutative100.0%

        \[\leadsto \mathsf{fma}\left(a + -0.5, b, \left(\color{blue}{\left(y + x\right)} + z\right) - z \cdot \log t\right) \]
      6. associate-+l+100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a + -0.5, b, \left(y + \left(x + z\right)\right) - z \cdot \log t\right)} \]
    4. Taylor expanded in z around 0 91.7%

      \[\leadsto \mathsf{fma}\left(a + -0.5, b, \color{blue}{y + x}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification91.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot \left(a - 0.5\right) \leq -2 \cdot 10^{+79}:\\ \;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\ \mathbf{elif}\;b \cdot \left(a - 0.5\right) \leq 10^{+46}:\\ \;\;\;\;\left(y + x\right) + z \cdot \left(1 - \log t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a + -0.5, b, y + x\right)\\ \end{array} \]

Alternative 3: 91.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.45 \cdot 10^{+60} \lor \neg \left(z \leq 2.05 \cdot 10^{+154}\right):\\ \;\;\;\;z \cdot \left(1 - \log t\right) + \left(y + b \cdot \left(a - 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -2.45e+60) (not (<= z 2.05e+154)))
   (+ (* z (- 1.0 (log t))) (+ y (* b (- a 0.5))))
   (+ (+ y x) (+ (* -0.5 b) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -2.45e+60) || !(z <= 2.05e+154)) {
		tmp = (z * (1.0 - log(t))) + (y + (b * (a - 0.5)));
	} else {
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    real(8) :: tmp
    if ((z <= (-2.45d+60)) .or. (.not. (z <= 2.05d+154))) then
        tmp = (z * (1.0d0 - log(t))) + (y + (b * (a - 0.5d0)))
    else
        tmp = (y + x) + (((-0.5d0) * b) + (a * b))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -2.45e+60) || !(z <= 2.05e+154)) {
		tmp = (z * (1.0 - Math.log(t))) + (y + (b * (a - 0.5)));
	} else {
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (z <= -2.45e+60) or not (z <= 2.05e+154):
		tmp = (z * (1.0 - math.log(t))) + (y + (b * (a - 0.5)))
	else:
		tmp = (y + x) + ((-0.5 * b) + (a * b))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -2.45e+60) || !(z <= 2.05e+154))
		tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(y + Float64(b * Float64(a - 0.5))));
	else
		tmp = Float64(Float64(y + x) + Float64(Float64(-0.5 * b) + Float64(a * b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((z <= -2.45e+60) || ~((z <= 2.05e+154)))
		tmp = (z * (1.0 - log(t))) + (y + (b * (a - 0.5)));
	else
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.45e+60], N[Not[LessEqual[z, 2.05e+154]], $MachinePrecision]], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + x), $MachinePrecision] + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{+60} \lor \neg \left(z \leq 2.05 \cdot 10^{+154}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + \left(y + b \cdot \left(a - 0.5\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.4500000000000001e60 or 2.05e154 < z

    1. Initial program 99.7%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.7%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.7%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.7%

        \[\leadsto \color{blue}{x + \left(y + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)\right)} \]
      4. +-commutative99.7%

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.7%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.7%

        \[\leadsto x + \left(\color{blue}{\left(\left(a - 0.5\right) \cdot b + y\right)} + \left(z - z \cdot \log t\right)\right) \]
      7. +-commutative99.7%

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.7%

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

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.7%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative99.7%

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.7%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.7%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.7%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.7%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.7%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in x around 0 94.1%

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

    if -2.4500000000000001e60 < z < 2.05e154

    1. Initial program 100.0%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+100.0%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+100.0%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+100.0%

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

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative100.0%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv100.0%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in100.0%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative100.0%

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def100.0%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg100.0%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def100.0%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg100.0%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval100.0%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in z around 0 98.2%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(y + x\right)} \]
    5. Taylor expanded in a around 0 98.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.45 \cdot 10^{+60} \lor \neg \left(z \leq 2.05 \cdot 10^{+154}\right):\\ \;\;\;\;z \cdot \left(1 - \log t\right) + \left(y + b \cdot \left(a - 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\ \end{array} \]

Alternative 4: 83.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(1 - \log t\right)\\ t_2 := y + t_1\\ \mathbf{if}\;z \leq -7 \cdot 10^{+225}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{+196}:\\ \;\;\;\;\left(y + x\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{+63}:\\ \;\;\;\;x + t_1\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+154}:\\ \;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* z (- 1.0 (log t)))) (t_2 (+ y t_1)))
   (if (<= z -7e+225)
     t_2
     (if (<= z -2.4e+196)
       (+ (+ y x) (* b (- a 0.5)))
       (if (<= z -4.1e+63)
         (+ x t_1)
         (if (<= z 1.8e+154) (+ (+ y x) (+ (* -0.5 b) (* a b))) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z * (1.0 - log(t));
	double t_2 = y + t_1;
	double tmp;
	if (z <= -7e+225) {
		tmp = t_2;
	} else if (z <= -2.4e+196) {
		tmp = (y + x) + (b * (a - 0.5));
	} else if (z <= -4.1e+63) {
		tmp = x + t_1;
	} else if (z <= 1.8e+154) {
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = z * (1.0d0 - log(t))
    t_2 = y + t_1
    if (z <= (-7d+225)) then
        tmp = t_2
    else if (z <= (-2.4d+196)) then
        tmp = (y + x) + (b * (a - 0.5d0))
    else if (z <= (-4.1d+63)) then
        tmp = x + t_1
    else if (z <= 1.8d+154) then
        tmp = (y + x) + (((-0.5d0) * b) + (a * b))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z * (1.0 - Math.log(t));
	double t_2 = y + t_1;
	double tmp;
	if (z <= -7e+225) {
		tmp = t_2;
	} else if (z <= -2.4e+196) {
		tmp = (y + x) + (b * (a - 0.5));
	} else if (z <= -4.1e+63) {
		tmp = x + t_1;
	} else if (z <= 1.8e+154) {
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = z * (1.0 - math.log(t))
	t_2 = y + t_1
	tmp = 0
	if z <= -7e+225:
		tmp = t_2
	elif z <= -2.4e+196:
		tmp = (y + x) + (b * (a - 0.5))
	elif z <= -4.1e+63:
		tmp = x + t_1
	elif z <= 1.8e+154:
		tmp = (y + x) + ((-0.5 * b) + (a * b))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(z * Float64(1.0 - log(t)))
	t_2 = Float64(y + t_1)
	tmp = 0.0
	if (z <= -7e+225)
		tmp = t_2;
	elseif (z <= -2.4e+196)
		tmp = Float64(Float64(y + x) + Float64(b * Float64(a - 0.5)));
	elseif (z <= -4.1e+63)
		tmp = Float64(x + t_1);
	elseif (z <= 1.8e+154)
		tmp = Float64(Float64(y + x) + Float64(Float64(-0.5 * b) + Float64(a * b)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = z * (1.0 - log(t));
	t_2 = y + t_1;
	tmp = 0.0;
	if (z <= -7e+225)
		tmp = t_2;
	elseif (z <= -2.4e+196)
		tmp = (y + x) + (b * (a - 0.5));
	elseif (z <= -4.1e+63)
		tmp = x + t_1;
	elseif (z <= 1.8e+154)
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + t$95$1), $MachinePrecision]}, If[LessEqual[z, -7e+225], t$95$2, If[LessEqual[z, -2.4e+196], N[(N[(y + x), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.1e+63], N[(x + t$95$1), $MachinePrecision], If[LessEqual[z, 1.8e+154], N[(N[(y + x), $MachinePrecision] + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
t_2 := y + t_1\\
\mathbf{if}\;z \leq -7 \cdot 10^{+225}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -2.4 \cdot 10^{+196}:\\
\;\;\;\;\left(y + x\right) + b \cdot \left(a - 0.5\right)\\

\mathbf{elif}\;z \leq -4.1 \cdot 10^{+63}:\\
\;\;\;\;x + t_1\\

\mathbf{elif}\;z \leq 1.8 \cdot 10^{+154}:\\
\;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.0000000000000006e225 or 1.8e154 < z

    1. Initial program 99.6%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.6%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.6%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.6%

        \[\leadsto \color{blue}{x + \left(y + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)\right)} \]
      4. +-commutative99.6%

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.6%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.6%

        \[\leadsto x + \left(\color{blue}{\left(\left(a - 0.5\right) \cdot b + y\right)} + \left(z - z \cdot \log t\right)\right) \]
      7. +-commutative99.6%

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.6%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.6%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.6%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative99.6%

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.6%

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(z, \left(-\log t\right) + 1, \left(a - 0.5\right) \cdot b + y\right)} \]
      13. +-commutative99.6%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.6%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.6%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.6%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.6%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + \color{blue}{-0.5}, b, y\right)\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in x around 0 99.6%

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)} \]
    5. Taylor expanded in b around 0 79.6%

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

    if -7.0000000000000006e225 < z < -2.4e196

    1. Initial program 99.7%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in z around 0 79.3%

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

    if -2.4e196 < z < -4.09999999999999993e63

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.8%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.8%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.8%

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

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

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

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.8%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.8%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative99.8%

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.8%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.8%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.8%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.8%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.8%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in z around inf 59.4%

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

    if -4.09999999999999993e63 < z < 1.8e154

    1. Initial program 100.0%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+100.0%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+100.0%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+100.0%

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

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative100.0%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv100.0%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in100.0%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative100.0%

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def100.0%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg100.0%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def100.0%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg100.0%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval100.0%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in z around 0 98.2%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(y + x\right)} \]
    5. Taylor expanded in a around 0 98.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+225}:\\ \;\;\;\;y + z \cdot \left(1 - \log t\right)\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{+196}:\\ \;\;\;\;\left(y + x\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{+63}:\\ \;\;\;\;x + z \cdot \left(1 - \log t\right)\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+154}:\\ \;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;y + z \cdot \left(1 - \log t\right)\\ \end{array} \]

Alternative 5: 83.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(1 - \log t\right)\\ \mathbf{if}\;z \leq -2.1 \cdot 10^{+227}:\\ \;\;\;\;y + t_1\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{+194}:\\ \;\;\;\;\left(y + x\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{+63}:\\ \;\;\;\;x + t_1\\ \mathbf{elif}\;z \leq 6.7 \cdot 10^{+156}:\\ \;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;y + \left(z - z \cdot \log t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* z (- 1.0 (log t)))))
   (if (<= z -2.1e+227)
     (+ y t_1)
     (if (<= z -5.5e+194)
       (+ (+ y x) (* b (- a 0.5)))
       (if (<= z -4.1e+63)
         (+ x t_1)
         (if (<= z 6.7e+156)
           (+ (+ y x) (+ (* -0.5 b) (* a b)))
           (+ y (- z (* z (log t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z * (1.0 - log(t));
	double tmp;
	if (z <= -2.1e+227) {
		tmp = y + t_1;
	} else if (z <= -5.5e+194) {
		tmp = (y + x) + (b * (a - 0.5));
	} else if (z <= -4.1e+63) {
		tmp = x + t_1;
	} else if (z <= 6.7e+156) {
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	} else {
		tmp = y + (z - (z * log(t)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * (1.0d0 - log(t))
    if (z <= (-2.1d+227)) then
        tmp = y + t_1
    else if (z <= (-5.5d+194)) then
        tmp = (y + x) + (b * (a - 0.5d0))
    else if (z <= (-4.1d+63)) then
        tmp = x + t_1
    else if (z <= 6.7d+156) then
        tmp = (y + x) + (((-0.5d0) * b) + (a * b))
    else
        tmp = y + (z - (z * log(t)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z * (1.0 - Math.log(t));
	double tmp;
	if (z <= -2.1e+227) {
		tmp = y + t_1;
	} else if (z <= -5.5e+194) {
		tmp = (y + x) + (b * (a - 0.5));
	} else if (z <= -4.1e+63) {
		tmp = x + t_1;
	} else if (z <= 6.7e+156) {
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	} else {
		tmp = y + (z - (z * Math.log(t)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = z * (1.0 - math.log(t))
	tmp = 0
	if z <= -2.1e+227:
		tmp = y + t_1
	elif z <= -5.5e+194:
		tmp = (y + x) + (b * (a - 0.5))
	elif z <= -4.1e+63:
		tmp = x + t_1
	elif z <= 6.7e+156:
		tmp = (y + x) + ((-0.5 * b) + (a * b))
	else:
		tmp = y + (z - (z * math.log(t)))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(z * Float64(1.0 - log(t)))
	tmp = 0.0
	if (z <= -2.1e+227)
		tmp = Float64(y + t_1);
	elseif (z <= -5.5e+194)
		tmp = Float64(Float64(y + x) + Float64(b * Float64(a - 0.5)));
	elseif (z <= -4.1e+63)
		tmp = Float64(x + t_1);
	elseif (z <= 6.7e+156)
		tmp = Float64(Float64(y + x) + Float64(Float64(-0.5 * b) + Float64(a * b)));
	else
		tmp = Float64(y + Float64(z - Float64(z * log(t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = z * (1.0 - log(t));
	tmp = 0.0;
	if (z <= -2.1e+227)
		tmp = y + t_1;
	elseif (z <= -5.5e+194)
		tmp = (y + x) + (b * (a - 0.5));
	elseif (z <= -4.1e+63)
		tmp = x + t_1;
	elseif (z <= 6.7e+156)
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	else
		tmp = y + (z - (z * log(t)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+227], N[(y + t$95$1), $MachinePrecision], If[LessEqual[z, -5.5e+194], N[(N[(y + x), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.1e+63], N[(x + t$95$1), $MachinePrecision], If[LessEqual[z, 6.7e+156], N[(N[(y + x), $MachinePrecision] + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+227}:\\
\;\;\;\;y + t_1\\

\mathbf{elif}\;z \leq -5.5 \cdot 10^{+194}:\\
\;\;\;\;\left(y + x\right) + b \cdot \left(a - 0.5\right)\\

\mathbf{elif}\;z \leq -4.1 \cdot 10^{+63}:\\
\;\;\;\;x + t_1\\

\mathbf{elif}\;z \leq 6.7 \cdot 10^{+156}:\\
\;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.10000000000000019e227

    1. Initial program 99.5%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.5%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.5%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.5%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.5%

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

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

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

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.5%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.5%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative99.5%

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.5%

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(z, \left(-\log t\right) + 1, \left(a - 0.5\right) \cdot b + y\right)} \]
      13. +-commutative99.5%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.5%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.5%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.5%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.5%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + \color{blue}{-0.5}, b, y\right)\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in x around 0 99.5%

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)} \]
    5. Taylor expanded in b around 0 93.7%

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

    if -2.10000000000000019e227 < z < -5.4999999999999999e194

    1. Initial program 99.7%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in z around 0 79.3%

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

    if -5.4999999999999999e194 < z < -4.09999999999999993e63

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.8%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.8%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.8%

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

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

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

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.8%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.8%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative99.8%

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.8%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.8%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.8%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.8%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.8%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in z around inf 59.4%

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

    if -4.09999999999999993e63 < z < 6.7e156

    1. Initial program 100.0%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+100.0%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+100.0%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+100.0%

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

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative100.0%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv100.0%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in100.0%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative100.0%

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def100.0%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg100.0%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def100.0%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg100.0%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval100.0%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in z around 0 98.2%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(y + x\right)} \]
    5. Taylor expanded in a around 0 98.2%

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

    if 6.7e156 < z

    1. Initial program 99.7%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.7%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.7%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.7%

        \[\leadsto \color{blue}{x + \left(y + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)\right)} \]
      4. +-commutative99.7%

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.7%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.7%

        \[\leadsto x + \left(\color{blue}{\left(\left(a - 0.5\right) \cdot b + y\right)} + \left(z - z \cdot \log t\right)\right) \]
      7. +-commutative99.7%

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.7%

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

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.7%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative99.7%

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.7%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.7%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.7%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.7%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.7%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in x around 0 99.7%

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)} \]
    5. Step-by-step derivation
      1. add-cube-cbrt98.6%

        \[\leadsto \color{blue}{\left(\sqrt[3]{z \cdot \left(1 - \log t\right)} \cdot \sqrt[3]{z \cdot \left(1 - \log t\right)}\right) \cdot \sqrt[3]{z \cdot \left(1 - \log t\right)}} + \left(\left(a - 0.5\right) \cdot b + y\right) \]
      2. pow398.8%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{z \cdot \left(1 - \log t\right)}\right)}^{3}} + \left(\left(a - 0.5\right) \cdot b + y\right) \]
      3. *-commutative98.8%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(1 - \log t\right) \cdot z}}\right)}^{3} + \left(\left(a - 0.5\right) \cdot b + y\right) \]
    6. Applied egg-rr98.8%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(1 - \log t\right) \cdot z}\right)}^{3}} + \left(\left(a - 0.5\right) \cdot b + y\right) \]
    7. Taylor expanded in b around 0 70.8%

      \[\leadsto \color{blue}{y + {1}^{0.3333333333333333} \cdot \left(z \cdot \left(1 - \log t\right)\right)} \]
    8. Step-by-step derivation
      1. +-commutative70.8%

        \[\leadsto \color{blue}{{1}^{0.3333333333333333} \cdot \left(z \cdot \left(1 - \log t\right)\right) + y} \]
      2. pow-base-170.8%

        \[\leadsto \color{blue}{1} \cdot \left(z \cdot \left(1 - \log t\right)\right) + y \]
      3. *-lft-identity70.8%

        \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right)} + y \]
      4. *-commutative70.8%

        \[\leadsto \color{blue}{\left(1 - \log t\right) \cdot z} + y \]
      5. sub-neg70.8%

        \[\leadsto \color{blue}{\left(1 + \left(-\log t\right)\right)} \cdot z + y \]
      6. log-rec70.8%

        \[\leadsto \left(1 + \color{blue}{\log \left(\frac{1}{t}\right)}\right) \cdot z + y \]
      7. +-commutative70.8%

        \[\leadsto \color{blue}{\left(\log \left(\frac{1}{t}\right) + 1\right)} \cdot z + y \]
      8. distribute-lft1-in70.8%

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

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

        \[\leadsto \left(z \cdot \color{blue}{\left(-\log t\right)} + z\right) + y \]
      11. distribute-rgt-neg-in70.8%

        \[\leadsto \left(\color{blue}{\left(-z \cdot \log t\right)} + z\right) + y \]
      12. +-commutative70.8%

        \[\leadsto \color{blue}{\left(z + \left(-z \cdot \log t\right)\right)} + y \]
      13. sub-neg70.8%

        \[\leadsto \color{blue}{\left(z - z \cdot \log t\right)} + y \]
      14. *-commutative70.8%

        \[\leadsto \left(z - \color{blue}{\log t \cdot z}\right) + y \]
    9. Simplified70.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{+227}:\\ \;\;\;\;y + z \cdot \left(1 - \log t\right)\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{+194}:\\ \;\;\;\;\left(y + x\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{+63}:\\ \;\;\;\;x + z \cdot \left(1 - \log t\right)\\ \mathbf{elif}\;z \leq 6.7 \cdot 10^{+156}:\\ \;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;y + \left(z - z \cdot \log t\right)\\ \end{array} \]

Alternative 6: 88.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+62} \lor \neg \left(z \leq 1.15 \cdot 10^{+152}\right):\\ \;\;\;\;z \cdot \left(1 - \log t\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -2.25e+62) (not (<= z 1.15e+152)))
   (+ (* z (- 1.0 (log t))) (* b (- a 0.5)))
   (+ (+ y x) (+ (* -0.5 b) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -2.25e+62) || !(z <= 1.15e+152)) {
		tmp = (z * (1.0 - log(t))) + (b * (a - 0.5));
	} else {
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    real(8) :: tmp
    if ((z <= (-2.25d+62)) .or. (.not. (z <= 1.15d+152))) then
        tmp = (z * (1.0d0 - log(t))) + (b * (a - 0.5d0))
    else
        tmp = (y + x) + (((-0.5d0) * b) + (a * b))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -2.25e+62) || !(z <= 1.15e+152)) {
		tmp = (z * (1.0 - Math.log(t))) + (b * (a - 0.5));
	} else {
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (z <= -2.25e+62) or not (z <= 1.15e+152):
		tmp = (z * (1.0 - math.log(t))) + (b * (a - 0.5))
	else:
		tmp = (y + x) + ((-0.5 * b) + (a * b))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -2.25e+62) || !(z <= 1.15e+152))
		tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(b * Float64(a - 0.5)));
	else
		tmp = Float64(Float64(y + x) + Float64(Float64(-0.5 * b) + Float64(a * b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((z <= -2.25e+62) || ~((z <= 1.15e+152)))
		tmp = (z * (1.0 - log(t))) + (b * (a - 0.5));
	else
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.25e+62], N[Not[LessEqual[z, 1.15e+152]], $MachinePrecision]], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + x), $MachinePrecision] + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+62} \lor \neg \left(z \leq 1.15 \cdot 10^{+152}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + b \cdot \left(a - 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.24999999999999999e62 or 1.14999999999999993e152 < z

    1. Initial program 99.7%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.7%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.7%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.7%

        \[\leadsto \color{blue}{x + \left(y + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)\right)} \]
      4. +-commutative99.7%

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.7%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.7%

        \[\leadsto x + \left(\color{blue}{\left(\left(a - 0.5\right) \cdot b + y\right)} + \left(z - z \cdot \log t\right)\right) \]
      7. +-commutative99.7%

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.7%

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

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.7%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative99.7%

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.7%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.7%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.7%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.7%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.7%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in x around 0 94.1%

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)} \]
    5. Taylor expanded in y around 0 84.6%

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \left(a - 0.5\right) \cdot b} \]

    if -2.24999999999999999e62 < z < 1.14999999999999993e152

    1. Initial program 100.0%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+100.0%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+100.0%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+100.0%

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

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative100.0%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv100.0%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in100.0%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative100.0%

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def100.0%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg100.0%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def100.0%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg100.0%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval100.0%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in z around 0 98.2%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(y + x\right)} \]
    5. Taylor expanded in a around 0 98.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+62} \lor \neg \left(z \leq 1.15 \cdot 10^{+152}\right):\\ \;\;\;\;z \cdot \left(1 - \log t\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\ \end{array} \]

Alternative 7: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(y + x\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (+ (+ y x) (- z (* z (log t)))) (* (+ a -0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((y + x) + (z - (z * log(t)))) + ((a + -0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    code = ((y + x) + (z - (z * log(t)))) + ((a + (-0.5d0)) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((y + x) + (z - (z * Math.log(t)))) + ((a + -0.5) * b);
}
def code(x, y, z, t, a, b):
	return ((y + x) + (z - (z * math.log(t)))) + ((a + -0.5) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(y + x) + Float64(z - Float64(z * log(t)))) + Float64(Float64(a + -0.5) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((y + x) + (z - (z * log(t)))) + ((a + -0.5) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(y + x), $MachinePrecision] + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(y + x\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Step-by-step derivation
    1. associate--l+99.9%

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
    2. sub-neg99.9%

      \[\leadsto \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \color{blue}{\left(a + \left(-0.5\right)\right)} \cdot b \]
    3. metadata-eval99.9%

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

    \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b} \]
  4. Final simplification99.9%

    \[\leadsto \left(\left(y + x\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b \]

Alternative 8: 82.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + z \cdot \left(1 - \log t\right)\\ \mathbf{if}\;z \leq -5 \cdot 10^{+224}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{+192}:\\ \;\;\;\;\left(y + x\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;z \leq -2.85 \cdot 10^{+63}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+156}:\\ \;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;z - z \cdot \log t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* z (- 1.0 (log t))))))
   (if (<= z -5e+224)
     t_1
     (if (<= z -1.75e+192)
       (+ (+ y x) (* b (- a 0.5)))
       (if (<= z -2.85e+63)
         t_1
         (if (<= z 5e+156)
           (+ (+ y x) (+ (* -0.5 b) (* a b)))
           (- z (* z (log t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (z * (1.0 - log(t)));
	double tmp;
	if (z <= -5e+224) {
		tmp = t_1;
	} else if (z <= -1.75e+192) {
		tmp = (y + x) + (b * (a - 0.5));
	} else if (z <= -2.85e+63) {
		tmp = t_1;
	} else if (z <= 5e+156) {
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	} else {
		tmp = z - (z * log(t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + (z * (1.0d0 - log(t)))
    if (z <= (-5d+224)) then
        tmp = t_1
    else if (z <= (-1.75d+192)) then
        tmp = (y + x) + (b * (a - 0.5d0))
    else if (z <= (-2.85d+63)) then
        tmp = t_1
    else if (z <= 5d+156) then
        tmp = (y + x) + (((-0.5d0) * b) + (a * b))
    else
        tmp = z - (z * log(t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (z * (1.0 - Math.log(t)));
	double tmp;
	if (z <= -5e+224) {
		tmp = t_1;
	} else if (z <= -1.75e+192) {
		tmp = (y + x) + (b * (a - 0.5));
	} else if (z <= -2.85e+63) {
		tmp = t_1;
	} else if (z <= 5e+156) {
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	} else {
		tmp = z - (z * Math.log(t));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (z * (1.0 - math.log(t)))
	tmp = 0
	if z <= -5e+224:
		tmp = t_1
	elif z <= -1.75e+192:
		tmp = (y + x) + (b * (a - 0.5))
	elif z <= -2.85e+63:
		tmp = t_1
	elif z <= 5e+156:
		tmp = (y + x) + ((-0.5 * b) + (a * b))
	else:
		tmp = z - (z * math.log(t))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(z * Float64(1.0 - log(t))))
	tmp = 0.0
	if (z <= -5e+224)
		tmp = t_1;
	elseif (z <= -1.75e+192)
		tmp = Float64(Float64(y + x) + Float64(b * Float64(a - 0.5)));
	elseif (z <= -2.85e+63)
		tmp = t_1;
	elseif (z <= 5e+156)
		tmp = Float64(Float64(y + x) + Float64(Float64(-0.5 * b) + Float64(a * b)));
	else
		tmp = Float64(z - Float64(z * log(t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (z * (1.0 - log(t)));
	tmp = 0.0;
	if (z <= -5e+224)
		tmp = t_1;
	elseif (z <= -1.75e+192)
		tmp = (y + x) + (b * (a - 0.5));
	elseif (z <= -2.85e+63)
		tmp = t_1;
	elseif (z <= 5e+156)
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	else
		tmp = z - (z * log(t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e+224], t$95$1, If[LessEqual[z, -1.75e+192], N[(N[(y + x), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.85e+63], t$95$1, If[LessEqual[z, 5e+156], N[(N[(y + x), $MachinePrecision] + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -5 \cdot 10^{+224}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1.75 \cdot 10^{+192}:\\
\;\;\;\;\left(y + x\right) + b \cdot \left(a - 0.5\right)\\

\mathbf{elif}\;z \leq -2.85 \cdot 10^{+63}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 5 \cdot 10^{+156}:\\
\;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;z - z \cdot \log t\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.99999999999999964e224 or -1.74999999999999991e192 < z < -2.8500000000000001e63

    1. Initial program 99.7%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.7%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.7%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.7%

        \[\leadsto \color{blue}{x + \left(y + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)\right)} \]
      4. +-commutative99.7%

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.7%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.7%

        \[\leadsto x + \left(\color{blue}{\left(\left(a - 0.5\right) \cdot b + y\right)} + \left(z - z \cdot \log t\right)\right) \]
      7. +-commutative99.7%

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.7%

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

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.7%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative99.7%

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.7%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.7%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.7%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.7%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.7%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in z around inf 69.4%

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

    if -4.99999999999999964e224 < z < -1.74999999999999991e192

    1. Initial program 99.7%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in z around 0 79.3%

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

    if -2.8500000000000001e63 < z < 4.99999999999999992e156

    1. Initial program 100.0%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+100.0%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+100.0%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+100.0%

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

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative100.0%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv100.0%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in100.0%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative100.0%

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def100.0%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg100.0%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def100.0%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg100.0%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval100.0%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in z around 0 98.2%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(y + x\right)} \]
    5. Taylor expanded in a around 0 98.2%

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

    if 4.99999999999999992e156 < z

    1. Initial program 99.7%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.7%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. sub-neg99.7%

        \[\leadsto \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \color{blue}{\left(a + \left(-0.5\right)\right)} \cdot b \]
      3. metadata-eval99.7%

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

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b} \]
    4. Taylor expanded in a around 0 99.7%

      \[\leadsto \color{blue}{\left(a \cdot b + \left(-0.5 \cdot b + \left(y + \left(z + x\right)\right)\right)\right) - z \cdot \log t} \]
    5. Taylor expanded in z around inf 67.4%

      \[\leadsto \color{blue}{\left(1 - \log t\right) \cdot z} \]
    6. Step-by-step derivation
      1. sub-neg67.4%

        \[\leadsto \color{blue}{\left(1 + \left(-\log t\right)\right)} \cdot z \]
      2. +-commutative67.4%

        \[\leadsto \color{blue}{\left(\left(-\log t\right) + 1\right)} \cdot z \]
      3. distribute-rgt1-in67.5%

        \[\leadsto \color{blue}{z + \left(-\log t\right) \cdot z} \]
      4. cancel-sign-sub-inv67.5%

        \[\leadsto \color{blue}{z - \log t \cdot z} \]
      5. *-commutative67.5%

        \[\leadsto z - \color{blue}{z \cdot \log t} \]
    7. Simplified67.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+224}:\\ \;\;\;\;x + z \cdot \left(1 - \log t\right)\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{+192}:\\ \;\;\;\;\left(y + x\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;z \leq -2.85 \cdot 10^{+63}:\\ \;\;\;\;x + z \cdot \left(1 - \log t\right)\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+156}:\\ \;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;z - z \cdot \log t\\ \end{array} \]

Alternative 9: 83.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+225} \lor \neg \left(z \leq 5.2 \cdot 10^{+156}\right):\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -1e+225) (not (<= z 5.2e+156)))
   (* z (- 1.0 (log t)))
   (+ (+ y x) (+ (* -0.5 b) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -1e+225) || !(z <= 5.2e+156)) {
		tmp = z * (1.0 - log(t));
	} else {
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    real(8) :: tmp
    if ((z <= (-1d+225)) .or. (.not. (z <= 5.2d+156))) then
        tmp = z * (1.0d0 - log(t))
    else
        tmp = (y + x) + (((-0.5d0) * b) + (a * b))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -1e+225) || !(z <= 5.2e+156)) {
		tmp = z * (1.0 - Math.log(t));
	} else {
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (z <= -1e+225) or not (z <= 5.2e+156):
		tmp = z * (1.0 - math.log(t))
	else:
		tmp = (y + x) + ((-0.5 * b) + (a * b))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -1e+225) || !(z <= 5.2e+156))
		tmp = Float64(z * Float64(1.0 - log(t)));
	else
		tmp = Float64(Float64(y + x) + Float64(Float64(-0.5 * b) + Float64(a * b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((z <= -1e+225) || ~((z <= 5.2e+156)))
		tmp = z * (1.0 - log(t));
	else
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1e+225], N[Not[LessEqual[z, 5.2e+156]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + x), $MachinePrecision] + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+225} \lor \neg \left(z \leq 5.2 \cdot 10^{+156}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.99999999999999928e224 or 5.20000000000000037e156 < z

    1. Initial program 99.6%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.6%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. sub-neg99.6%

        \[\leadsto \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \color{blue}{\left(a + \left(-0.5\right)\right)} \cdot b \]
      3. metadata-eval99.6%

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

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b} \]
    4. Taylor expanded in a around 0 99.6%

      \[\leadsto \color{blue}{\left(a \cdot b + \left(-0.5 \cdot b + \left(y + \left(z + x\right)\right)\right)\right) - z \cdot \log t} \]
    5. Taylor expanded in z around inf 74.7%

      \[\leadsto \color{blue}{\left(1 - \log t\right) \cdot z} \]

    if -9.99999999999999928e224 < z < 5.20000000000000037e156

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in z around 0 90.9%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(y + x\right)} \]
    5. Taylor expanded in a around 0 90.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+225} \lor \neg \left(z \leq 5.2 \cdot 10^{+156}\right):\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\ \end{array} \]

Alternative 10: 83.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+224}:\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+157}:\\ \;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;z - z \cdot \log t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -5.2e+224)
   (* z (- 1.0 (log t)))
   (if (<= z 2.05e+157)
     (+ (+ y x) (+ (* -0.5 b) (* a b)))
     (- z (* z (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -5.2e+224) {
		tmp = z * (1.0 - log(t));
	} else if (z <= 2.05e+157) {
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	} else {
		tmp = z - (z * log(t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    real(8) :: tmp
    if (z <= (-5.2d+224)) then
        tmp = z * (1.0d0 - log(t))
    else if (z <= 2.05d+157) then
        tmp = (y + x) + (((-0.5d0) * b) + (a * b))
    else
        tmp = z - (z * log(t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -5.2e+224) {
		tmp = z * (1.0 - Math.log(t));
	} else if (z <= 2.05e+157) {
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	} else {
		tmp = z - (z * Math.log(t));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -5.2e+224:
		tmp = z * (1.0 - math.log(t))
	elif z <= 2.05e+157:
		tmp = (y + x) + ((-0.5 * b) + (a * b))
	else:
		tmp = z - (z * math.log(t))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -5.2e+224)
		tmp = Float64(z * Float64(1.0 - log(t)));
	elseif (z <= 2.05e+157)
		tmp = Float64(Float64(y + x) + Float64(Float64(-0.5 * b) + Float64(a * b)));
	else
		tmp = Float64(z - Float64(z * log(t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (z <= -5.2e+224)
		tmp = z * (1.0 - log(t));
	elseif (z <= 2.05e+157)
		tmp = (y + x) + ((-0.5 * b) + (a * b));
	else
		tmp = z - (z * log(t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.2e+224], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.05e+157], N[(N[(y + x), $MachinePrecision] + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+224}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\

\mathbf{elif}\;z \leq 2.05 \cdot 10^{+157}:\\
\;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;z - z \cdot \log t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.2000000000000001e224

    1. Initial program 99.5%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.5%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. sub-neg99.5%

        \[\leadsto \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \color{blue}{\left(a + \left(-0.5\right)\right)} \cdot b \]
      3. metadata-eval99.5%

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

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b} \]
    4. Taylor expanded in a around 0 99.5%

      \[\leadsto \color{blue}{\left(a \cdot b + \left(-0.5 \cdot b + \left(y + \left(z + x\right)\right)\right)\right) - z \cdot \log t} \]
    5. Taylor expanded in z around inf 86.3%

      \[\leadsto \color{blue}{\left(1 - \log t\right) \cdot z} \]

    if -5.2000000000000001e224 < z < 2.05000000000000008e157

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in z around 0 90.9%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(y + x\right)} \]
    5. Taylor expanded in a around 0 90.9%

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

    if 2.05000000000000008e157 < z

    1. Initial program 99.7%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.7%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. sub-neg99.7%

        \[\leadsto \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \color{blue}{\left(a + \left(-0.5\right)\right)} \cdot b \]
      3. metadata-eval99.7%

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

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b} \]
    4. Taylor expanded in a around 0 99.7%

      \[\leadsto \color{blue}{\left(a \cdot b + \left(-0.5 \cdot b + \left(y + \left(z + x\right)\right)\right)\right) - z \cdot \log t} \]
    5. Taylor expanded in z around inf 67.4%

      \[\leadsto \color{blue}{\left(1 - \log t\right) \cdot z} \]
    6. Step-by-step derivation
      1. sub-neg67.4%

        \[\leadsto \color{blue}{\left(1 + \left(-\log t\right)\right)} \cdot z \]
      2. +-commutative67.4%

        \[\leadsto \color{blue}{\left(\left(-\log t\right) + 1\right)} \cdot z \]
      3. distribute-rgt1-in67.5%

        \[\leadsto \color{blue}{z + \left(-\log t\right) \cdot z} \]
      4. cancel-sign-sub-inv67.5%

        \[\leadsto \color{blue}{z - \log t \cdot z} \]
      5. *-commutative67.5%

        \[\leadsto z - \color{blue}{z \cdot \log t} \]
    7. Simplified67.5%

      \[\leadsto \color{blue}{z - z \cdot \log t} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification88.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+224}:\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+157}:\\ \;\;\;\;\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;z - z \cdot \log t\\ \end{array} \]

Alternative 11: 63.7% accurate, 6.7× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+79} \lor \neg \left(t_1 \leq 5 \cdot 10^{+181}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a 1/2) b) < -1.99999999999999993e79 or 5.0000000000000003e181 < (*.f64 (-.f64 a 1/2) b)

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. sub-neg99.9%

        \[\leadsto \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \color{blue}{\left(a + \left(-0.5\right)\right)} \cdot b \]
      3. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b} \]
    4. Taylor expanded in a around 0 99.9%

      \[\leadsto \color{blue}{\left(a \cdot b + \left(-0.5 \cdot b + \left(y + \left(z + x\right)\right)\right)\right) - z \cdot \log t} \]
    5. Taylor expanded in b around inf 78.2%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b} \]

    if -1.99999999999999993e79 < (*.f64 (-.f64 a 1/2) b) < 5.0000000000000003e181

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in y around inf 59.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot \left(a - 0.5\right) \leq -2 \cdot 10^{+79} \lor \neg \left(b \cdot \left(a - 0.5\right) \leq 5 \cdot 10^{+181}\right):\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]

Alternative 12: 35.8% accurate, 8.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -3.5 \cdot 10^{+92}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \leq -9 \cdot 10^{-42}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.4 \cdot 10^{-100}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{elif}\;a \leq -2.4 \cdot 10^{-220}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.45 \cdot 10^{+47}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -3.5e+92)
   (* a b)
   (if (<= a -9e-42)
     x
     (if (<= a -1.4e-100)
       (* -0.5 b)
       (if (<= a -2.4e-220) x (if (<= a 1.45e+47) (* -0.5 b) (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -3.5e+92) {
		tmp = a * b;
	} else if (a <= -9e-42) {
		tmp = x;
	} else if (a <= -1.4e-100) {
		tmp = -0.5 * b;
	} else if (a <= -2.4e-220) {
		tmp = x;
	} else if (a <= 1.45e+47) {
		tmp = -0.5 * b;
	} else {
		tmp = a * b;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    real(8) :: tmp
    if (a <= (-3.5d+92)) then
        tmp = a * b
    else if (a <= (-9d-42)) then
        tmp = x
    else if (a <= (-1.4d-100)) then
        tmp = (-0.5d0) * b
    else if (a <= (-2.4d-220)) then
        tmp = x
    else if (a <= 1.45d+47) then
        tmp = (-0.5d0) * b
    else
        tmp = a * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -3.5e+92) {
		tmp = a * b;
	} else if (a <= -9e-42) {
		tmp = x;
	} else if (a <= -1.4e-100) {
		tmp = -0.5 * b;
	} else if (a <= -2.4e-220) {
		tmp = x;
	} else if (a <= 1.45e+47) {
		tmp = -0.5 * b;
	} else {
		tmp = a * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -3.5e+92:
		tmp = a * b
	elif a <= -9e-42:
		tmp = x
	elif a <= -1.4e-100:
		tmp = -0.5 * b
	elif a <= -2.4e-220:
		tmp = x
	elif a <= 1.45e+47:
		tmp = -0.5 * b
	else:
		tmp = a * b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -3.5e+92)
		tmp = Float64(a * b);
	elseif (a <= -9e-42)
		tmp = x;
	elseif (a <= -1.4e-100)
		tmp = Float64(-0.5 * b);
	elseif (a <= -2.4e-220)
		tmp = x;
	elseif (a <= 1.45e+47)
		tmp = Float64(-0.5 * b);
	else
		tmp = Float64(a * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -3.5e+92)
		tmp = a * b;
	elseif (a <= -9e-42)
		tmp = x;
	elseif (a <= -1.4e-100)
		tmp = -0.5 * b;
	elseif (a <= -2.4e-220)
		tmp = x;
	elseif (a <= 1.45e+47)
		tmp = -0.5 * b;
	else
		tmp = a * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3.5e+92], N[(a * b), $MachinePrecision], If[LessEqual[a, -9e-42], x, If[LessEqual[a, -1.4e-100], N[(-0.5 * b), $MachinePrecision], If[LessEqual[a, -2.4e-220], x, If[LessEqual[a, 1.45e+47], N[(-0.5 * b), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{+92}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;a \leq -9 \cdot 10^{-42}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq -1.4 \cdot 10^{-100}:\\
\;\;\;\;-0.5 \cdot b\\

\mathbf{elif}\;a \leq -2.4 \cdot 10^{-220}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.45 \cdot 10^{+47}:\\
\;\;\;\;-0.5 \cdot b\\

\mathbf{else}:\\
\;\;\;\;a \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.49999999999999986e92 or 1.4499999999999999e47 < a

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. sub-neg99.9%

        \[\leadsto \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \color{blue}{\left(a + \left(-0.5\right)\right)} \cdot b \]
      3. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b} \]
    4. Taylor expanded in a around 0 99.9%

      \[\leadsto \color{blue}{\left(a \cdot b + \left(-0.5 \cdot b + \left(y + \left(z + x\right)\right)\right)\right) - z \cdot \log t} \]
    5. Taylor expanded in a around inf 61.4%

      \[\leadsto \color{blue}{a \cdot b} \]
    6. Step-by-step derivation
      1. *-commutative61.4%

        \[\leadsto \color{blue}{b \cdot a} \]
    7. Simplified61.4%

      \[\leadsto \color{blue}{b \cdot a} \]

    if -3.49999999999999986e92 < a < -9e-42 or -1.39999999999999998e-100 < a < -2.4000000000000001e-220

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.8%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.8%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.8%

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

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

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

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.8%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.8%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative99.8%

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.8%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.8%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.8%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.8%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.8%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in x around inf 28.1%

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

    if -9e-42 < a < -1.39999999999999998e-100 or -2.4000000000000001e-220 < a < 1.4499999999999999e47

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. sub-neg99.9%

        \[\leadsto \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \color{blue}{\left(a + \left(-0.5\right)\right)} \cdot b \]
      3. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b} \]
    4. Taylor expanded in a around 0 99.9%

      \[\leadsto \color{blue}{\left(a \cdot b + \left(-0.5 \cdot b + \left(y + \left(z + x\right)\right)\right)\right) - z \cdot \log t} \]
    5. Taylor expanded in b around inf 36.3%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b} \]
    6. Taylor expanded in a around 0 36.0%

      \[\leadsto \color{blue}{-0.5 \cdot b} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification44.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.5 \cdot 10^{+92}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \leq -9 \cdot 10^{-42}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.4 \cdot 10^{-100}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{elif}\;a \leq -2.4 \cdot 10^{-220}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.45 \cdot 10^{+47}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]

Alternative 13: 53.0% accurate, 8.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y + x \leq -20000000000000:\\ \;\;\;\;x + a \cdot b\\ \mathbf{elif}\;y + x \leq 5 \cdot 10^{+144}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= (+ y x) -20000000000000.0)
   (+ x (* a b))
   (if (<= (+ y x) 5e+144) (* b (- a 0.5)) (+ y x))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y + x) <= -20000000000000.0) {
		tmp = x + (a * b);
	} else if ((y + x) <= 5e+144) {
		tmp = b * (a - 0.5);
	} else {
		tmp = y + x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    real(8) :: tmp
    if ((y + x) <= (-20000000000000.0d0)) then
        tmp = x + (a * b)
    else if ((y + x) <= 5d+144) then
        tmp = b * (a - 0.5d0)
    else
        tmp = y + x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y + x) <= -20000000000000.0) {
		tmp = x + (a * b);
	} else if ((y + x) <= 5e+144) {
		tmp = b * (a - 0.5);
	} else {
		tmp = y + x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y + x) <= -20000000000000.0:
		tmp = x + (a * b)
	elif (y + x) <= 5e+144:
		tmp = b * (a - 0.5)
	else:
		tmp = y + x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(y + x) <= -20000000000000.0)
		tmp = Float64(x + Float64(a * b));
	elseif (Float64(y + x) <= 5e+144)
		tmp = Float64(b * Float64(a - 0.5));
	else
		tmp = Float64(y + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((y + x) <= -20000000000000.0)
		tmp = x + (a * b);
	elseif ((y + x) <= 5e+144)
		tmp = b * (a - 0.5);
	else
		tmp = y + x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y + x), $MachinePrecision], -20000000000000.0], N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y + x), $MachinePrecision], 5e+144], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y + x \leq -20000000000000:\\
\;\;\;\;x + a \cdot b\\

\mathbf{elif}\;y + x \leq 5 \cdot 10^{+144}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x y) < -2e13

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in a around inf 49.5%

      \[\leadsto x + \color{blue}{a \cdot b} \]

    if -2e13 < (+.f64 x y) < 4.9999999999999999e144

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. sub-neg99.9%

        \[\leadsto \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \color{blue}{\left(a + \left(-0.5\right)\right)} \cdot b \]
      3. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b} \]
    4. Taylor expanded in a around 0 99.9%

      \[\leadsto \color{blue}{\left(a \cdot b + \left(-0.5 \cdot b + \left(y + \left(z + x\right)\right)\right)\right) - z \cdot \log t} \]
    5. Taylor expanded in b around inf 60.3%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b} \]

    if 4.9999999999999999e144 < (+.f64 x y)

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in y around inf 61.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y + x \leq -20000000000000:\\ \;\;\;\;x + a \cdot b\\ \mathbf{elif}\;y + x \leq 5 \cdot 10^{+144}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]

Alternative 14: 45.0% accurate, 8.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y + x \leq -20000000000000:\\ \;\;\;\;x + a \cdot b\\ \mathbf{elif}\;y + x \leq 2 \cdot 10^{-41}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y + -0.5 \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= (+ y x) -20000000000000.0)
   (+ x (* a b))
   (if (<= (+ y x) 2e-41) (* b (- a 0.5)) (+ y (* -0.5 b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y + x) <= -20000000000000.0) {
		tmp = x + (a * b);
	} else if ((y + x) <= 2e-41) {
		tmp = b * (a - 0.5);
	} else {
		tmp = y + (-0.5 * b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    real(8) :: tmp
    if ((y + x) <= (-20000000000000.0d0)) then
        tmp = x + (a * b)
    else if ((y + x) <= 2d-41) then
        tmp = b * (a - 0.5d0)
    else
        tmp = y + ((-0.5d0) * b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y + x) <= -20000000000000.0) {
		tmp = x + (a * b);
	} else if ((y + x) <= 2e-41) {
		tmp = b * (a - 0.5);
	} else {
		tmp = y + (-0.5 * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y + x) <= -20000000000000.0:
		tmp = x + (a * b)
	elif (y + x) <= 2e-41:
		tmp = b * (a - 0.5)
	else:
		tmp = y + (-0.5 * b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(y + x) <= -20000000000000.0)
		tmp = Float64(x + Float64(a * b));
	elseif (Float64(y + x) <= 2e-41)
		tmp = Float64(b * Float64(a - 0.5));
	else
		tmp = Float64(y + Float64(-0.5 * b));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((y + x) <= -20000000000000.0)
		tmp = x + (a * b);
	elseif ((y + x) <= 2e-41)
		tmp = b * (a - 0.5);
	else
		tmp = y + (-0.5 * b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y + x), $MachinePrecision], -20000000000000.0], N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y + x), $MachinePrecision], 2e-41], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y + x \leq -20000000000000:\\
\;\;\;\;x + a \cdot b\\

\mathbf{elif}\;y + x \leq 2 \cdot 10^{-41}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\

\mathbf{else}:\\
\;\;\;\;y + -0.5 \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x y) < -2e13

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in a around inf 49.5%

      \[\leadsto x + \color{blue}{a \cdot b} \]

    if -2e13 < (+.f64 x y) < 2.00000000000000001e-41

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. sub-neg99.9%

        \[\leadsto \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \color{blue}{\left(a + \left(-0.5\right)\right)} \cdot b \]
      3. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b} \]
    4. Taylor expanded in a around 0 99.9%

      \[\leadsto \color{blue}{\left(a \cdot b + \left(-0.5 \cdot b + \left(y + \left(z + x\right)\right)\right)\right) - z \cdot \log t} \]
    5. Taylor expanded in b around inf 68.8%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b} \]

    if 2.00000000000000001e-41 < (+.f64 x y)

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

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

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(y + x\right)} \]
    5. Taylor expanded in x around 0 58.7%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + y} \]
    6. Taylor expanded in a around 0 40.1%

      \[\leadsto \color{blue}{-0.5 \cdot b + y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification51.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y + x \leq -20000000000000:\\ \;\;\;\;x + a \cdot b\\ \mathbf{elif}\;y + x \leq 2 \cdot 10^{-41}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y + -0.5 \cdot b\\ \end{array} \]

Alternative 15: 49.8% accurate, 8.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y + x \leq -20000000000000:\\ \;\;\;\;x + a \cdot b\\ \mathbf{elif}\;y + x \leq 10^{+97}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y + a \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= (+ y x) -20000000000000.0)
   (+ x (* a b))
   (if (<= (+ y x) 1e+97) (* b (- a 0.5)) (+ y (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y + x) <= -20000000000000.0) {
		tmp = x + (a * b);
	} else if ((y + x) <= 1e+97) {
		tmp = b * (a - 0.5);
	} else {
		tmp = y + (a * b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    real(8) :: tmp
    if ((y + x) <= (-20000000000000.0d0)) then
        tmp = x + (a * b)
    else if ((y + x) <= 1d+97) then
        tmp = b * (a - 0.5d0)
    else
        tmp = y + (a * b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y + x) <= -20000000000000.0) {
		tmp = x + (a * b);
	} else if ((y + x) <= 1e+97) {
		tmp = b * (a - 0.5);
	} else {
		tmp = y + (a * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y + x) <= -20000000000000.0:
		tmp = x + (a * b)
	elif (y + x) <= 1e+97:
		tmp = b * (a - 0.5)
	else:
		tmp = y + (a * b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(y + x) <= -20000000000000.0)
		tmp = Float64(x + Float64(a * b));
	elseif (Float64(y + x) <= 1e+97)
		tmp = Float64(b * Float64(a - 0.5));
	else
		tmp = Float64(y + Float64(a * b));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((y + x) <= -20000000000000.0)
		tmp = x + (a * b);
	elseif ((y + x) <= 1e+97)
		tmp = b * (a - 0.5);
	else
		tmp = y + (a * b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y + x), $MachinePrecision], -20000000000000.0], N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y + x), $MachinePrecision], 1e+97], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y + x \leq -20000000000000:\\
\;\;\;\;x + a \cdot b\\

\mathbf{elif}\;y + x \leq 10^{+97}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\

\mathbf{else}:\\
\;\;\;\;y + a \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x y) < -2e13

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in a around inf 49.5%

      \[\leadsto x + \color{blue}{a \cdot b} \]

    if -2e13 < (+.f64 x y) < 1.0000000000000001e97

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. sub-neg99.9%

        \[\leadsto \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \color{blue}{\left(a + \left(-0.5\right)\right)} \cdot b \]
      3. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b} \]
    4. Taylor expanded in a around 0 99.9%

      \[\leadsto \color{blue}{\left(a \cdot b + \left(-0.5 \cdot b + \left(y + \left(z + x\right)\right)\right)\right) - z \cdot \log t} \]
    5. Taylor expanded in b around inf 62.4%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b} \]

    if 1.0000000000000001e97 < (+.f64 x y)

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.8%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.8%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.8%

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

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

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

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.8%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.8%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative99.8%

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.8%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.8%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.8%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.8%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.8%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in z around 0 86.7%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(y + x\right)} \]
    5. Taylor expanded in x around 0 58.6%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + y} \]
    6. Taylor expanded in a around 0 58.7%

      \[\leadsto \color{blue}{\left(a \cdot b + -0.5 \cdot b\right)} + y \]
    7. Taylor expanded in a around inf 49.3%

      \[\leadsto \color{blue}{a \cdot b} + y \]
    8. Step-by-step derivation
      1. *-commutative49.3%

        \[\leadsto \color{blue}{b \cdot a} + y \]
    9. Simplified49.3%

      \[\leadsto \color{blue}{b \cdot a} + y \]
  3. Recombined 3 regimes into one program.
  4. Final simplification54.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y + x \leq -20000000000000:\\ \;\;\;\;x + a \cdot b\\ \mathbf{elif}\;y + x \leq 10^{+97}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y + a \cdot b\\ \end{array} \]

Alternative 16: 25.7% accurate, 10.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -170000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -2.2 \cdot 10^{-171}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{elif}\;x \leq -1.12 \cdot 10^{-244}:\\ \;\;\;\;y\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-295}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -170000000000.0)
   x
   (if (<= x -2.2e-171)
     (* -0.5 b)
     (if (<= x -1.12e-244) y (if (<= x 2e-295) (* -0.5 b) y)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -170000000000.0) {
		tmp = x;
	} else if (x <= -2.2e-171) {
		tmp = -0.5 * b;
	} else if (x <= -1.12e-244) {
		tmp = y;
	} else if (x <= 2e-295) {
		tmp = -0.5 * b;
	} else {
		tmp = y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    real(8) :: tmp
    if (x <= (-170000000000.0d0)) then
        tmp = x
    else if (x <= (-2.2d-171)) then
        tmp = (-0.5d0) * b
    else if (x <= (-1.12d-244)) then
        tmp = y
    else if (x <= 2d-295) then
        tmp = (-0.5d0) * b
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -170000000000.0) {
		tmp = x;
	} else if (x <= -2.2e-171) {
		tmp = -0.5 * b;
	} else if (x <= -1.12e-244) {
		tmp = y;
	} else if (x <= 2e-295) {
		tmp = -0.5 * b;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -170000000000.0:
		tmp = x
	elif x <= -2.2e-171:
		tmp = -0.5 * b
	elif x <= -1.12e-244:
		tmp = y
	elif x <= 2e-295:
		tmp = -0.5 * b
	else:
		tmp = y
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -170000000000.0)
		tmp = x;
	elseif (x <= -2.2e-171)
		tmp = Float64(-0.5 * b);
	elseif (x <= -1.12e-244)
		tmp = y;
	elseif (x <= 2e-295)
		tmp = Float64(-0.5 * b);
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= -170000000000.0)
		tmp = x;
	elseif (x <= -2.2e-171)
		tmp = -0.5 * b;
	elseif (x <= -1.12e-244)
		tmp = y;
	elseif (x <= 2e-295)
		tmp = -0.5 * b;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -170000000000.0], x, If[LessEqual[x, -2.2e-171], N[(-0.5 * b), $MachinePrecision], If[LessEqual[x, -1.12e-244], y, If[LessEqual[x, 2e-295], N[(-0.5 * b), $MachinePrecision], y]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -2.2 \cdot 10^{-171}:\\
\;\;\;\;-0.5 \cdot b\\

\mathbf{elif}\;x \leq -1.12 \cdot 10^{-244}:\\
\;\;\;\;y\\

\mathbf{elif}\;x \leq 2 \cdot 10^{-295}:\\
\;\;\;\;-0.5 \cdot b\\

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


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

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in x around inf 47.9%

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

    if -1.7e11 < x < -2.2000000000000001e-171 or -1.1200000000000001e-244 < x < 2.00000000000000012e-295

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. sub-neg99.9%

        \[\leadsto \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \color{blue}{\left(a + \left(-0.5\right)\right)} \cdot b \]
      3. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b} \]
    4. Taylor expanded in a around 0 99.9%

      \[\leadsto \color{blue}{\left(a \cdot b + \left(-0.5 \cdot b + \left(y + \left(z + x\right)\right)\right)\right) - z \cdot \log t} \]
    5. Taylor expanded in b around inf 53.4%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b} \]
    6. Taylor expanded in a around 0 29.7%

      \[\leadsto \color{blue}{-0.5 \cdot b} \]

    if -2.2000000000000001e-171 < x < -1.1200000000000001e-244 or 2.00000000000000012e-295 < x

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. sub-neg99.9%

        \[\leadsto \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \color{blue}{\left(a + \left(-0.5\right)\right)} \cdot b \]
      3. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b} \]
    4. Taylor expanded in a around 0 99.9%

      \[\leadsto \color{blue}{\left(a \cdot b + \left(-0.5 \cdot b + \left(y + \left(z + x\right)\right)\right)\right) - z \cdot \log t} \]
    5. Taylor expanded in y around inf 22.8%

      \[\leadsto \color{blue}{y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification30.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -170000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -2.2 \cdot 10^{-171}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{elif}\;x \leq -1.12 \cdot 10^{-244}:\\ \;\;\;\;y\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-295}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 17: 50.2% accurate, 10.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -3.5 \cdot 10^{+91}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \leq -2.4 \cdot 10^{-42}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;a \leq -2.5 \cdot 10^{-74}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{elif}\;a \leq 3.7 \cdot 10^{+120}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -3.5e+91)
   (* a b)
   (if (<= a -2.4e-42)
     (+ y x)
     (if (<= a -2.5e-74) (* -0.5 b) (if (<= a 3.7e+120) (+ y x) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -3.5e+91) {
		tmp = a * b;
	} else if (a <= -2.4e-42) {
		tmp = y + x;
	} else if (a <= -2.5e-74) {
		tmp = -0.5 * b;
	} else if (a <= 3.7e+120) {
		tmp = y + x;
	} else {
		tmp = a * b;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    real(8) :: tmp
    if (a <= (-3.5d+91)) then
        tmp = a * b
    else if (a <= (-2.4d-42)) then
        tmp = y + x
    else if (a <= (-2.5d-74)) then
        tmp = (-0.5d0) * b
    else if (a <= 3.7d+120) then
        tmp = y + x
    else
        tmp = a * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -3.5e+91) {
		tmp = a * b;
	} else if (a <= -2.4e-42) {
		tmp = y + x;
	} else if (a <= -2.5e-74) {
		tmp = -0.5 * b;
	} else if (a <= 3.7e+120) {
		tmp = y + x;
	} else {
		tmp = a * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -3.5e+91:
		tmp = a * b
	elif a <= -2.4e-42:
		tmp = y + x
	elif a <= -2.5e-74:
		tmp = -0.5 * b
	elif a <= 3.7e+120:
		tmp = y + x
	else:
		tmp = a * b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -3.5e+91)
		tmp = Float64(a * b);
	elseif (a <= -2.4e-42)
		tmp = Float64(y + x);
	elseif (a <= -2.5e-74)
		tmp = Float64(-0.5 * b);
	elseif (a <= 3.7e+120)
		tmp = Float64(y + x);
	else
		tmp = Float64(a * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -3.5e+91)
		tmp = a * b;
	elseif (a <= -2.4e-42)
		tmp = y + x;
	elseif (a <= -2.5e-74)
		tmp = -0.5 * b;
	elseif (a <= 3.7e+120)
		tmp = y + x;
	else
		tmp = a * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3.5e+91], N[(a * b), $MachinePrecision], If[LessEqual[a, -2.4e-42], N[(y + x), $MachinePrecision], If[LessEqual[a, -2.5e-74], N[(-0.5 * b), $MachinePrecision], If[LessEqual[a, 3.7e+120], N[(y + x), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{+91}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;a \leq -2.4 \cdot 10^{-42}:\\
\;\;\;\;y + x\\

\mathbf{elif}\;a \leq -2.5 \cdot 10^{-74}:\\
\;\;\;\;-0.5 \cdot b\\

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

\mathbf{else}:\\
\;\;\;\;a \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.50000000000000001e91 or 3.70000000000000024e120 < a

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. sub-neg99.9%

        \[\leadsto \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \color{blue}{\left(a + \left(-0.5\right)\right)} \cdot b \]
      3. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b} \]
    4. Taylor expanded in a around 0 99.9%

      \[\leadsto \color{blue}{\left(a \cdot b + \left(-0.5 \cdot b + \left(y + \left(z + x\right)\right)\right)\right) - z \cdot \log t} \]
    5. Taylor expanded in a around inf 62.9%

      \[\leadsto \color{blue}{a \cdot b} \]
    6. Step-by-step derivation
      1. *-commutative62.9%

        \[\leadsto \color{blue}{b \cdot a} \]
    7. Simplified62.9%

      \[\leadsto \color{blue}{b \cdot a} \]

    if -3.50000000000000001e91 < a < -2.40000000000000003e-42 or -2.49999999999999999e-74 < a < 3.70000000000000024e120

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in y around inf 48.6%

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

    if -2.40000000000000003e-42 < a < -2.49999999999999999e-74

    1. Initial program 100.0%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+100.0%

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

        \[\leadsto \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \color{blue}{\left(a + \left(-0.5\right)\right)} \cdot b \]
      3. metadata-eval100.0%

        \[\leadsto \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + \color{blue}{-0.5}\right) \cdot b \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b} \]
    4. Taylor expanded in a around 0 100.0%

      \[\leadsto \color{blue}{\left(a \cdot b + \left(-0.5 \cdot b + \left(y + \left(z + x\right)\right)\right)\right) - z \cdot \log t} \]
    5. Taylor expanded in b around inf 86.0%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b} \]
    6. Taylor expanded in a around 0 86.0%

      \[\leadsto \color{blue}{-0.5 \cdot b} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification54.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.5 \cdot 10^{+91}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \leq -2.4 \cdot 10^{-42}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;a \leq -2.5 \cdot 10^{-74}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{elif}\;a \leq 3.7 \cdot 10^{+120}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]

Alternative 18: 55.5% accurate, 10.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y + x \leq 10^{+97}:\\ \;\;\;\;x + b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y + a \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= (+ y x) 1e+97) (+ x (* b (- a 0.5))) (+ y (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y + x) <= 1e+97) {
		tmp = x + (b * (a - 0.5));
	} else {
		tmp = y + (a * b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    real(8) :: tmp
    if ((y + x) <= 1d+97) then
        tmp = x + (b * (a - 0.5d0))
    else
        tmp = y + (a * b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y + x) <= 1e+97) {
		tmp = x + (b * (a - 0.5));
	} else {
		tmp = y + (a * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y + x) <= 1e+97:
		tmp = x + (b * (a - 0.5))
	else:
		tmp = y + (a * b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(y + x) <= 1e+97)
		tmp = Float64(x + Float64(b * Float64(a - 0.5)));
	else
		tmp = Float64(y + Float64(a * b));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((y + x) <= 1e+97)
		tmp = x + (b * (a - 0.5));
	else
		tmp = y + (a * b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y + x), $MachinePrecision], 1e+97], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y + x \leq 10^{+97}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\

\mathbf{else}:\\
\;\;\;\;y + a \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x y) < 1.0000000000000001e97

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in b around inf 59.4%

      \[\leadsto x + \color{blue}{\left(a - 0.5\right) \cdot b} \]

    if 1.0000000000000001e97 < (+.f64 x y)

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.8%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.8%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.8%

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

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

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

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.8%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.8%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative99.8%

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.8%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.8%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.8%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.8%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.8%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in z around 0 86.7%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(y + x\right)} \]
    5. Taylor expanded in x around 0 58.6%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + y} \]
    6. Taylor expanded in a around 0 58.7%

      \[\leadsto \color{blue}{\left(a \cdot b + -0.5 \cdot b\right)} + y \]
    7. Taylor expanded in a around inf 49.3%

      \[\leadsto \color{blue}{a \cdot b} + y \]
    8. Step-by-step derivation
      1. *-commutative49.3%

        \[\leadsto \color{blue}{b \cdot a} + y \]
    9. Simplified49.3%

      \[\leadsto \color{blue}{b \cdot a} + y \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y + x \leq 10^{+97}:\\ \;\;\;\;x + b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y + a \cdot b\\ \end{array} \]

Alternative 19: 57.9% accurate, 10.4× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;y + x \leq 2 \cdot 10^{-87}:\\
\;\;\;\;x + t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x y) < 2.00000000000000004e-87

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in b around inf 59.4%

      \[\leadsto x + \color{blue}{\left(a - 0.5\right) \cdot b} \]

    if 2.00000000000000004e-87 < (+.f64 x y)

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in z around 0 80.5%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(y + x\right)} \]
    5. Taylor expanded in x around 0 61.1%

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.1%

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

Alternative 20: 78.5% accurate, 10.5× speedup?

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

\\
\left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Step-by-step derivation
    1. associate--l+99.9%

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
    2. associate-+l+99.9%

      \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
    3. associate-+l+99.9%

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

      \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
    5. associate-+r+99.9%

      \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
    6. +-commutative99.9%

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

      \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
    8. *-commutative99.9%

      \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
    9. cancel-sign-sub-inv99.9%

      \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
    10. distribute-rgt1-in99.9%

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

      \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
    12. fma-def99.9%

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

      \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
    14. unsub-neg99.9%

      \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
    15. fma-def99.9%

      \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
    16. sub-neg99.9%

      \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
    17. metadata-eval99.9%

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

    \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
  4. Taylor expanded in z around 0 79.7%

    \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(y + x\right)} \]
  5. Taylor expanded in a around 0 79.7%

    \[\leadsto \color{blue}{\left(a \cdot b + -0.5 \cdot b\right)} + \left(y + x\right) \]
  6. Final simplification79.7%

    \[\leadsto \left(y + x\right) + \left(-0.5 \cdot b + a \cdot b\right) \]

Alternative 21: 78.5% accurate, 12.8× speedup?

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

\\
\left(y + x\right) + b \cdot \left(a - 0.5\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Step-by-step derivation
    1. associate--l+99.9%

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
    2. associate-+l+99.9%

      \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
    3. associate-+l+99.9%

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

      \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
    5. associate-+r+99.9%

      \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
    6. +-commutative99.9%

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

      \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
    8. *-commutative99.9%

      \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
    9. cancel-sign-sub-inv99.9%

      \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
    10. distribute-rgt1-in99.9%

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

      \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
    12. fma-def99.9%

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

      \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
    14. unsub-neg99.9%

      \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
    15. fma-def99.9%

      \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
    16. sub-neg99.9%

      \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
    17. metadata-eval99.9%

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

    \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
  4. Taylor expanded in z around 0 79.7%

    \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(y + x\right)} \]
  5. Final simplification79.7%

    \[\leadsto \left(y + x\right) + b \cdot \left(a - 0.5\right) \]

Alternative 22: 27.9% accurate, 37.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2600000000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z t a b) :precision binary64 (if (<= x -2600000000000.0) x y))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -2600000000000.0) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    real(8) :: tmp
    if (x <= (-2600000000000.0d0)) then
        tmp = x
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -2600000000000.0) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -2600000000000.0:
		tmp = x
	else:
		tmp = y
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -2600000000000.0)
		tmp = x;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= -2600000000000.0)
		tmp = x;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2600000000000.0], x, y]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.6e12

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
      3. associate-+l+99.9%

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

        \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
      5. associate-+r+99.9%

        \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
      6. +-commutative99.9%

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

        \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
      8. *-commutative99.9%

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

        \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      12. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
      15. fma-def99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg99.9%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
    4. Taylor expanded in x around inf 47.9%

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

    if -2.6e12 < x

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. sub-neg99.9%

        \[\leadsto \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \color{blue}{\left(a + \left(-0.5\right)\right)} \cdot b \]
      3. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b} \]
    4. Taylor expanded in a around 0 99.9%

      \[\leadsto \color{blue}{\left(a \cdot b + \left(-0.5 \cdot b + \left(y + \left(z + x\right)\right)\right)\right) - z \cdot \log t} \]
    5. Taylor expanded in y around inf 24.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2600000000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 23: 21.3% accurate, 115.0× speedup?

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

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

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Step-by-step derivation
    1. associate--l+99.9%

      \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
    2. associate-+l+99.9%

      \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]
    3. associate-+l+99.9%

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

      \[\leadsto x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
    5. associate-+r+99.9%

      \[\leadsto x + \color{blue}{\left(\left(y + \left(a - 0.5\right) \cdot b\right) + \left(z - z \cdot \log t\right)\right)} \]
    6. +-commutative99.9%

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

      \[\leadsto x + \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right)} \]
    8. *-commutative99.9%

      \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
    9. cancel-sign-sub-inv99.9%

      \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
    10. distribute-rgt1-in99.9%

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

      \[\leadsto x + \left(\color{blue}{z \cdot \left(\left(-\log t\right) + 1\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
    12. fma-def99.9%

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

      \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
    14. unsub-neg99.9%

      \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 - \log t}, \left(a - 0.5\right) \cdot b + y\right) \]
    15. fma-def99.9%

      \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
    16. sub-neg99.9%

      \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
    17. metadata-eval99.9%

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

    \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)} \]
  4. Taylor expanded in x around inf 19.0%

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

    \[\leadsto x \]

Developer target: 99.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \left(\left(x + y\right) + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+
  (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t))))
  (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x + y) + (((1.0 - pow(log(t), 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    code = ((x + y) + (((1.0d0 - (log(t) ** 2.0d0)) * z) / (1.0d0 + log(t)))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((x + y) + (((1.0 - Math.pow(Math.log(t), 2.0)) * z) / (1.0 + Math.log(t)))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b):
	return ((x + y) + (((1.0 - math.pow(math.log(t), 2.0)) * z) / (1.0 + math.log(t)))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x + y) + Float64(Float64(Float64(1.0 - (log(t) ^ 2.0)) * z) / Float64(1.0 + log(t)))) + Float64(Float64(a - 0.5) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((x + y) + (((1.0 - (log(t) ^ 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + y), $MachinePrecision] + N[(N[(N[(1.0 - N[Power[N[Log[t], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] / N[(1.0 + N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x + y\right) + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b
\end{array}

Reproduce

?
herbie shell --seed 2023195 
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))

  (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))