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

Percentage Accurate: 99.8% → 99.9%
Time: 17.7s
Alternatives: 23
Speedup: 0.5×

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.9% accurate, 0.5× speedup?

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

\\
z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\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. associate--l+99.9%

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

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

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

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

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

      \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
    8. distribute-rgt-out--99.9%

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

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

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

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

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

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

Alternative 2: 87.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \log t\\ t_2 := b \cdot \left(a - 0.5\right)\\ t_3 := t\_2 + \left(z - t\_1\right)\\ \mathbf{if}\;z \leq -7.2 \cdot 10^{+224}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{+117}:\\ \;\;\;\;\left(z + \left(\left(x + y\right) - t\_1\right)\right) + -0.5 \cdot b\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+46}:\\ \;\;\;\;\left(x + y\right) + t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* z (log t))) (t_2 (* b (- a 0.5))) (t_3 (+ t_2 (- z t_1))))
   (if (<= z -7.2e+224)
     t_3
     (if (<= z -3.1e+117)
       (+ (+ z (- (+ x y) t_1)) (* -0.5 b))
       (if (<= z 1.6e+46) (+ (+ x y) t_2) t_3)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z * log(t);
	double t_2 = b * (a - 0.5);
	double t_3 = t_2 + (z - t_1);
	double tmp;
	if (z <= -7.2e+224) {
		tmp = t_3;
	} else if (z <= -3.1e+117) {
		tmp = (z + ((x + y) - t_1)) + (-0.5 * b);
	} else if (z <= 1.6e+46) {
		tmp = (x + y) + t_2;
	} else {
		tmp = t_3;
	}
	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) :: t_3
    real(8) :: tmp
    t_1 = z * log(t)
    t_2 = b * (a - 0.5d0)
    t_3 = t_2 + (z - t_1)
    if (z <= (-7.2d+224)) then
        tmp = t_3
    else if (z <= (-3.1d+117)) then
        tmp = (z + ((x + y) - t_1)) + ((-0.5d0) * b)
    else if (z <= 1.6d+46) then
        tmp = (x + y) + t_2
    else
        tmp = t_3
    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 * Math.log(t);
	double t_2 = b * (a - 0.5);
	double t_3 = t_2 + (z - t_1);
	double tmp;
	if (z <= -7.2e+224) {
		tmp = t_3;
	} else if (z <= -3.1e+117) {
		tmp = (z + ((x + y) - t_1)) + (-0.5 * b);
	} else if (z <= 1.6e+46) {
		tmp = (x + y) + t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = z * math.log(t)
	t_2 = b * (a - 0.5)
	t_3 = t_2 + (z - t_1)
	tmp = 0
	if z <= -7.2e+224:
		tmp = t_3
	elif z <= -3.1e+117:
		tmp = (z + ((x + y) - t_1)) + (-0.5 * b)
	elif z <= 1.6e+46:
		tmp = (x + y) + t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(z * log(t))
	t_2 = Float64(b * Float64(a - 0.5))
	t_3 = Float64(t_2 + Float64(z - t_1))
	tmp = 0.0
	if (z <= -7.2e+224)
		tmp = t_3;
	elseif (z <= -3.1e+117)
		tmp = Float64(Float64(z + Float64(Float64(x + y) - t_1)) + Float64(-0.5 * b));
	elseif (z <= 1.6e+46)
		tmp = Float64(Float64(x + y) + t_2);
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = z * log(t);
	t_2 = b * (a - 0.5);
	t_3 = t_2 + (z - t_1);
	tmp = 0.0;
	if (z <= -7.2e+224)
		tmp = t_3;
	elseif (z <= -3.1e+117)
		tmp = (z + ((x + y) - t_1)) + (-0.5 * b);
	elseif (z <= 1.6e+46)
		tmp = (x + y) + t_2;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(z - t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.2e+224], t$95$3, If[LessEqual[z, -3.1e+117], N[(N[(z + N[(N[(x + y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+46], N[(N[(x + y), $MachinePrecision] + t$95$2), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \log t\\
t_2 := b \cdot \left(a - 0.5\right)\\
t_3 := t\_2 + \left(z - t\_1\right)\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+224}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq -3.1 \cdot 10^{+117}:\\
\;\;\;\;\left(z + \left(\left(x + y\right) - t\_1\right)\right) + -0.5 \cdot b\\

\mathbf{elif}\;z \leq 1.6 \cdot 10^{+46}:\\
\;\;\;\;\left(x + y\right) + t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.2e224 or 1.5999999999999999e46 < z

    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. Add Preprocessing
    3. Taylor expanded in y around 0 93.3%

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

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

    if -7.2e224 < z < -3.09999999999999975e117

    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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutative99.7%

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

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

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

      \[\leadsto \left(z + \left(\left(x + y\right) - z \cdot \log t\right)\right) + \color{blue}{-0.5 \cdot b} \]
    6. Step-by-step derivation
      1. *-commutative87.1%

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

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

    if -3.09999999999999975e117 < z < 1.5999999999999999e46

    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. Add Preprocessing
    3. Taylor expanded in z around 0 96.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+224}:\\ \;\;\;\;b \cdot \left(a - 0.5\right) + \left(z - z \cdot \log t\right)\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{+117}:\\ \;\;\;\;\left(z + \left(\left(x + y\right) - z \cdot \log t\right)\right) + -0.5 \cdot b\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+46}:\\ \;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a - 0.5\right) + \left(z - z \cdot \log t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 81.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;z \leq 7 \cdot 10^{+200}:\\ \;\;\;\;\left(x + y\right) + t\_1\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{+223}:\\ \;\;\;\;\left(z \cdot b\right) \cdot \frac{1 - \log t}{b}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+247}:\\ \;\;\;\;y + t\_1\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - z \cdot \log t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (- a 0.5))))
   (if (<= z 7e+200)
     (+ (+ x y) t_1)
     (if (<= z 8.2e+223)
       (* (* z b) (/ (- 1.0 (log t)) b))
       (if (<= z 5.8e+247) (+ y t_1) (+ x (- z (* z (log t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (a - 0.5);
	double tmp;
	if (z <= 7e+200) {
		tmp = (x + y) + t_1;
	} else if (z <= 8.2e+223) {
		tmp = (z * b) * ((1.0 - log(t)) / b);
	} else if (z <= 5.8e+247) {
		tmp = y + t_1;
	} else {
		tmp = x + (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 = b * (a - 0.5d0)
    if (z <= 7d+200) then
        tmp = (x + y) + t_1
    else if (z <= 8.2d+223) then
        tmp = (z * b) * ((1.0d0 - log(t)) / b)
    else if (z <= 5.8d+247) then
        tmp = y + t_1
    else
        tmp = x + (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 = b * (a - 0.5);
	double tmp;
	if (z <= 7e+200) {
		tmp = (x + y) + t_1;
	} else if (z <= 8.2e+223) {
		tmp = (z * b) * ((1.0 - Math.log(t)) / b);
	} else if (z <= 5.8e+247) {
		tmp = y + t_1;
	} else {
		tmp = x + (z - (z * Math.log(t)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (a - 0.5)
	tmp = 0
	if z <= 7e+200:
		tmp = (x + y) + t_1
	elif z <= 8.2e+223:
		tmp = (z * b) * ((1.0 - math.log(t)) / b)
	elif z <= 5.8e+247:
		tmp = y + t_1
	else:
		tmp = x + (z - (z * math.log(t)))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(b * Float64(a - 0.5))
	tmp = 0.0
	if (z <= 7e+200)
		tmp = Float64(Float64(x + y) + t_1);
	elseif (z <= 8.2e+223)
		tmp = Float64(Float64(z * b) * Float64(Float64(1.0 - log(t)) / b));
	elseif (z <= 5.8e+247)
		tmp = Float64(y + t_1);
	else
		tmp = Float64(x + Float64(z - Float64(z * log(t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = b * (a - 0.5);
	tmp = 0.0;
	if (z <= 7e+200)
		tmp = (x + y) + t_1;
	elseif (z <= 8.2e+223)
		tmp = (z * b) * ((1.0 - log(t)) / b);
	elseif (z <= 5.8e+247)
		tmp = y + t_1;
	else
		tmp = x + (z - (z * log(t)));
	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[z, 7e+200], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 8.2e+223], N[(N[(z * b), $MachinePrecision] * N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+247], N[(y + t$95$1), $MachinePrecision], N[(x + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 8.2 \cdot 10^{+223}:\\
\;\;\;\;\left(z \cdot b\right) \cdot \frac{1 - \log t}{b}\\

\mathbf{elif}\;z \leq 5.8 \cdot 10^{+247}:\\
\;\;\;\;y + t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < 7.00000000000000013e200

    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. Add Preprocessing
    3. Taylor expanded in z around 0 88.9%

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

    if 7.00000000000000013e200 < z < 8.2e223

    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. Add Preprocessing
    3. Taylor expanded in y around inf 31.6%

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

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

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

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

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

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

        \[\leadsto y \cdot \left(\left(1 + \frac{x}{y}\right) + \frac{\color{blue}{z \cdot 1} - z \cdot \log t}{y}\right) + \left(a - 0.5\right) \cdot b \]
      7. distribute-lft-out--32.3%

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \left(\left(a + \frac{z \cdot \left(1 - \log t\right)}{b}\right) - 0.5\right)} \]
    8. Step-by-step derivation
      1. associate--l+71.8%

        \[\leadsto b \cdot \color{blue}{\left(a + \left(\frac{z \cdot \left(1 - \log t\right)}{b} - 0.5\right)\right)} \]
      2. associate-/l*71.4%

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

      \[\leadsto \color{blue}{b \cdot \left(a + \left(z \cdot \frac{1 - \log t}{b} - 0.5\right)\right)} \]
    10. Taylor expanded in z around inf 43.0%

      \[\leadsto \color{blue}{b \cdot \left(z \cdot \left(\frac{1}{b} - \frac{\log t}{b}\right)\right)} \]
    11. Step-by-step derivation
      1. div-sub43.0%

        \[\leadsto b \cdot \left(z \cdot \color{blue}{\frac{1 - \log t}{b}}\right) \]
      2. associate-*r*80.6%

        \[\leadsto \color{blue}{\left(b \cdot z\right) \cdot \frac{1 - \log t}{b}} \]
    12. Simplified80.6%

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

    if 8.2e223 < z < 5.8000000000000004e247

    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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutative99.7%

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

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

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

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

    if 5.8000000000000004e247 < 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. +-commutative99.7%

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

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.5%

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{z \cdot \left(1 - \log t\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-out--87.8%

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

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

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

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

        \[\leadsto x + \left(y + \left(z + \color{blue}{z \cdot \left(-\log t\right)}\right)\right) \]
    8. Applied egg-rr81.7%

      \[\leadsto x + \color{blue}{\left(z + z \cdot \left(-\log t\right)\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-neg-out81.7%

        \[\leadsto x + \left(z + \color{blue}{\left(-z \cdot \log t\right)}\right) \]
      2. unsub-neg81.7%

        \[\leadsto x + \color{blue}{\left(z - z \cdot \log t\right)} \]
    10. Applied egg-rr81.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 7 \cdot 10^{+200}:\\ \;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{+223}:\\ \;\;\;\;\left(z \cdot b\right) \cdot \frac{1 - \log t}{b}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+247}:\\ \;\;\;\;y + b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - z \cdot \log t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 81.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;z \leq 1.18 \cdot 10^{+201}:\\ \;\;\;\;\left(x + y\right) + t\_1\\ \mathbf{elif}\;z \leq 1.66 \cdot 10^{+226}:\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{+247}:\\ \;\;\;\;y + t\_1\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - z \cdot \log t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (- a 0.5))))
   (if (<= z 1.18e+201)
     (+ (+ x y) t_1)
     (if (<= z 1.66e+226)
       (* z (- 1.0 (log t)))
       (if (<= z 4.7e+247) (+ y t_1) (+ x (- z (* z (log t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (a - 0.5);
	double tmp;
	if (z <= 1.18e+201) {
		tmp = (x + y) + t_1;
	} else if (z <= 1.66e+226) {
		tmp = z * (1.0 - log(t));
	} else if (z <= 4.7e+247) {
		tmp = y + t_1;
	} else {
		tmp = x + (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 = b * (a - 0.5d0)
    if (z <= 1.18d+201) then
        tmp = (x + y) + t_1
    else if (z <= 1.66d+226) then
        tmp = z * (1.0d0 - log(t))
    else if (z <= 4.7d+247) then
        tmp = y + t_1
    else
        tmp = x + (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 = b * (a - 0.5);
	double tmp;
	if (z <= 1.18e+201) {
		tmp = (x + y) + t_1;
	} else if (z <= 1.66e+226) {
		tmp = z * (1.0 - Math.log(t));
	} else if (z <= 4.7e+247) {
		tmp = y + t_1;
	} else {
		tmp = x + (z - (z * Math.log(t)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (a - 0.5)
	tmp = 0
	if z <= 1.18e+201:
		tmp = (x + y) + t_1
	elif z <= 1.66e+226:
		tmp = z * (1.0 - math.log(t))
	elif z <= 4.7e+247:
		tmp = y + t_1
	else:
		tmp = x + (z - (z * math.log(t)))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(b * Float64(a - 0.5))
	tmp = 0.0
	if (z <= 1.18e+201)
		tmp = Float64(Float64(x + y) + t_1);
	elseif (z <= 1.66e+226)
		tmp = Float64(z * Float64(1.0 - log(t)));
	elseif (z <= 4.7e+247)
		tmp = Float64(y + t_1);
	else
		tmp = Float64(x + Float64(z - Float64(z * log(t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = b * (a - 0.5);
	tmp = 0.0;
	if (z <= 1.18e+201)
		tmp = (x + y) + t_1;
	elseif (z <= 1.66e+226)
		tmp = z * (1.0 - log(t));
	elseif (z <= 4.7e+247)
		tmp = y + t_1;
	else
		tmp = x + (z - (z * log(t)));
	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[z, 1.18e+201], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 1.66e+226], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.7e+247], N[(y + t$95$1), $MachinePrecision], N[(x + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 1.66 \cdot 10^{+226}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\

\mathbf{elif}\;z \leq 4.7 \cdot 10^{+247}:\\
\;\;\;\;y + t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < 1.18e201

    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. Add Preprocessing
    3. Taylor expanded in z around 0 88.9%

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

    if 1.18e201 < z < 1.6600000000000001e226

    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. Add Preprocessing
    3. Taylor expanded in y around inf 29.3%

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(\left(1 + \frac{x}{y}\right) + \left(\frac{z}{y} + \left(-\frac{z \cdot \log t}{y}\right)\right)\right)} + \left(a - 0.5\right) \cdot b \]
      4. sub-neg29.3%

        \[\leadsto y \cdot \left(\left(1 + \frac{x}{y}\right) + \color{blue}{\left(\frac{z}{y} - \frac{z \cdot \log t}{y}\right)}\right) + \left(a - 0.5\right) \cdot b \]
      5. div-sub29.9%

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

        \[\leadsto y \cdot \left(\left(1 + \frac{x}{y}\right) + \frac{\color{blue}{z \cdot 1} - z \cdot \log t}{y}\right) + \left(a - 0.5\right) \cdot b \]
      7. distribute-lft-out--29.9%

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

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

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

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

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

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

    if 1.6600000000000001e226 < z < 4.7000000000000002e247

    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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutative100.0%

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

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

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

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

    if 4.7000000000000002e247 < 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. +-commutative99.7%

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

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.5%

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{z \cdot \left(1 - \log t\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-out--87.8%

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

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

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

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

        \[\leadsto x + \left(y + \left(z + \color{blue}{z \cdot \left(-\log t\right)}\right)\right) \]
    8. Applied egg-rr81.7%

      \[\leadsto x + \color{blue}{\left(z + z \cdot \left(-\log t\right)\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-neg-out81.7%

        \[\leadsto x + \left(z + \color{blue}{\left(-z \cdot \log t\right)}\right) \]
      2. unsub-neg81.7%

        \[\leadsto x + \color{blue}{\left(z - z \cdot \log t\right)} \]
    10. Applied egg-rr81.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 1.18 \cdot 10^{+201}:\\ \;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;z \leq 1.66 \cdot 10^{+226}:\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{+247}:\\ \;\;\;\;y + b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - z \cdot \log t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 81.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(1 - \log t\right)\\ t_2 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;z \leq 2.2 \cdot 10^{+198}:\\ \;\;\;\;\left(x + y\right) + t\_2\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+227}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+248}:\\ \;\;\;\;y + t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1 + x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* z (- 1.0 (log t)))) (t_2 (* b (- a 0.5))))
   (if (<= z 2.2e+198)
     (+ (+ x y) t_2)
     (if (<= z 2.4e+227) t_1 (if (<= z 2.4e+248) (+ y t_2) (+ t_1 x))))))
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 = b * (a - 0.5);
	double tmp;
	if (z <= 2.2e+198) {
		tmp = (x + y) + t_2;
	} else if (z <= 2.4e+227) {
		tmp = t_1;
	} else if (z <= 2.4e+248) {
		tmp = y + t_2;
	} else {
		tmp = t_1 + 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) :: t_2
    real(8) :: tmp
    t_1 = z * (1.0d0 - log(t))
    t_2 = b * (a - 0.5d0)
    if (z <= 2.2d+198) then
        tmp = (x + y) + t_2
    else if (z <= 2.4d+227) then
        tmp = t_1
    else if (z <= 2.4d+248) then
        tmp = y + t_2
    else
        tmp = t_1 + 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 = z * (1.0 - Math.log(t));
	double t_2 = b * (a - 0.5);
	double tmp;
	if (z <= 2.2e+198) {
		tmp = (x + y) + t_2;
	} else if (z <= 2.4e+227) {
		tmp = t_1;
	} else if (z <= 2.4e+248) {
		tmp = y + t_2;
	} else {
		tmp = t_1 + x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = z * (1.0 - math.log(t))
	t_2 = b * (a - 0.5)
	tmp = 0
	if z <= 2.2e+198:
		tmp = (x + y) + t_2
	elif z <= 2.4e+227:
		tmp = t_1
	elif z <= 2.4e+248:
		tmp = y + t_2
	else:
		tmp = t_1 + x
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(z * Float64(1.0 - log(t)))
	t_2 = Float64(b * Float64(a - 0.5))
	tmp = 0.0
	if (z <= 2.2e+198)
		tmp = Float64(Float64(x + y) + t_2);
	elseif (z <= 2.4e+227)
		tmp = t_1;
	elseif (z <= 2.4e+248)
		tmp = Float64(y + t_2);
	else
		tmp = Float64(t_1 + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = z * (1.0 - log(t));
	t_2 = b * (a - 0.5);
	tmp = 0.0;
	if (z <= 2.2e+198)
		tmp = (x + y) + t_2;
	elseif (z <= 2.4e+227)
		tmp = t_1;
	elseif (z <= 2.4e+248)
		tmp = y + t_2;
	else
		tmp = t_1 + x;
	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[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 2.2e+198], N[(N[(x + y), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[z, 2.4e+227], t$95$1, If[LessEqual[z, 2.4e+248], N[(y + t$95$2), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
t_2 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;z \leq 2.2 \cdot 10^{+198}:\\
\;\;\;\;\left(x + y\right) + t\_2\\

\mathbf{elif}\;z \leq 2.4 \cdot 10^{+227}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2.4 \cdot 10^{+248}:\\
\;\;\;\;y + t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < 2.2e198

    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. Add Preprocessing
    3. Taylor expanded in z around 0 88.9%

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

    if 2.2e198 < z < 2.3999999999999998e227

    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. Add Preprocessing
    3. Taylor expanded in y around inf 29.3%

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(\left(1 + \frac{x}{y}\right) + \left(\frac{z}{y} + \left(-\frac{z \cdot \log t}{y}\right)\right)\right)} + \left(a - 0.5\right) \cdot b \]
      4. sub-neg29.3%

        \[\leadsto y \cdot \left(\left(1 + \frac{x}{y}\right) + \color{blue}{\left(\frac{z}{y} - \frac{z \cdot \log t}{y}\right)}\right) + \left(a - 0.5\right) \cdot b \]
      5. div-sub29.9%

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

        \[\leadsto y \cdot \left(\left(1 + \frac{x}{y}\right) + \frac{\color{blue}{z \cdot 1} - z \cdot \log t}{y}\right) + \left(a - 0.5\right) \cdot b \]
      7. distribute-lft-out--29.9%

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

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

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

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

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

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

    if 2.3999999999999998e227 < z < 2.4e248

    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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutative100.0%

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

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

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

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

    if 2.4e248 < 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. +-commutative99.7%

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

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.5%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 2.2 \cdot 10^{+198}:\\ \;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+227}:\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+248}:\\ \;\;\;\;y + b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(1 - \log t\right) + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 85.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;z \leq -7.5 \cdot 10^{+242} \lor \neg \left(z \leq 1.6 \cdot 10^{+46}\right):\\ \;\;\;\;t\_1 + \left(z - z \cdot \log t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) + t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (- a 0.5))))
   (if (or (<= z -7.5e+242) (not (<= z 1.6e+46)))
     (+ t_1 (- z (* z (log t))))
     (+ (+ x 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 ((z <= -7.5e+242) || !(z <= 1.6e+46)) {
		tmp = t_1 + (z - (z * log(t)));
	} else {
		tmp = (x + 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 ((z <= (-7.5d+242)) .or. (.not. (z <= 1.6d+46))) then
        tmp = t_1 + (z - (z * log(t)))
    else
        tmp = (x + 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 ((z <= -7.5e+242) || !(z <= 1.6e+46)) {
		tmp = t_1 + (z - (z * Math.log(t)));
	} else {
		tmp = (x + y) + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (a - 0.5)
	tmp = 0
	if (z <= -7.5e+242) or not (z <= 1.6e+46):
		tmp = t_1 + (z - (z * math.log(t)))
	else:
		tmp = (x + 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 ((z <= -7.5e+242) || !(z <= 1.6e+46))
		tmp = Float64(t_1 + Float64(z - Float64(z * log(t))));
	else
		tmp = Float64(Float64(x + 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 ((z <= -7.5e+242) || ~((z <= 1.6e+46)))
		tmp = t_1 + (z - (z * log(t)));
	else
		tmp = (x + 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[Or[LessEqual[z, -7.5e+242], N[Not[LessEqual[z, 1.6e+46]], $MachinePrecision]], N[(t$95$1 + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;z \leq -7.5 \cdot 10^{+242} \lor \neg \left(z \leq 1.6 \cdot 10^{+46}\right):\\
\;\;\;\;t\_1 + \left(z - z \cdot \log t\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.49999999999999961e242 or 1.5999999999999999e46 < z

    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. Add Preprocessing
    3. Taylor expanded in y around 0 92.6%

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

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

    if -7.49999999999999961e242 < z < 1.5999999999999999e46

    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. Add Preprocessing
    3. Taylor expanded in z around 0 92.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+242} \lor \neg \left(z \leq 1.6 \cdot 10^{+46}\right):\\ \;\;\;\;b \cdot \left(a - 0.5\right) + \left(z - z \cdot \log t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 81.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;z \leq 1.08 \cdot 10^{+201}:\\ \;\;\;\;\left(x + y\right) + t\_1\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+233} \lor \neg \left(z \leq 4.8 \cdot 10^{+247}\right):\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \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 (<= z 1.08e+201)
     (+ (+ x y) t_1)
     (if (or (<= z 4.6e+233) (not (<= z 4.8e+247)))
       (* z (- 1.0 (log t)))
       (+ 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 (z <= 1.08e+201) {
		tmp = (x + y) + t_1;
	} else if ((z <= 4.6e+233) || !(z <= 4.8e+247)) {
		tmp = z * (1.0 - log(t));
	} 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 (z <= 1.08d+201) then
        tmp = (x + y) + t_1
    else if ((z <= 4.6d+233) .or. (.not. (z <= 4.8d+247))) then
        tmp = z * (1.0d0 - log(t))
    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 (z <= 1.08e+201) {
		tmp = (x + y) + t_1;
	} else if ((z <= 4.6e+233) || !(z <= 4.8e+247)) {
		tmp = z * (1.0 - Math.log(t));
	} else {
		tmp = y + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (a - 0.5)
	tmp = 0
	if z <= 1.08e+201:
		tmp = (x + y) + t_1
	elif (z <= 4.6e+233) or not (z <= 4.8e+247):
		tmp = z * (1.0 - math.log(t))
	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 (z <= 1.08e+201)
		tmp = Float64(Float64(x + y) + t_1);
	elseif ((z <= 4.6e+233) || !(z <= 4.8e+247))
		tmp = Float64(z * Float64(1.0 - log(t)));
	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 (z <= 1.08e+201)
		tmp = (x + y) + t_1;
	elseif ((z <= 4.6e+233) || ~((z <= 4.8e+247)))
		tmp = z * (1.0 - log(t));
	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[z, 1.08e+201], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], If[Or[LessEqual[z, 4.6e+233], N[Not[LessEqual[z, 4.8e+247]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 4.6 \cdot 10^{+233} \lor \neg \left(z \leq 4.8 \cdot 10^{+247}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < 1.08000000000000006e201

    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. Add Preprocessing
    3. Taylor expanded in z around 0 88.9%

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

    if 1.08000000000000006e201 < z < 4.60000000000000001e233 or 4.8e247 < 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. Add Preprocessing
    3. Taylor expanded in y around inf 43.2%

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

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

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

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

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

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

        \[\leadsto y \cdot \left(\left(1 + \frac{x}{y}\right) + \frac{\color{blue}{z \cdot 1} - z \cdot \log t}{y}\right) + \left(a - 0.5\right) \cdot b \]
      7. distribute-lft-out--45.5%

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

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

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

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

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

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

    if 4.60000000000000001e233 < z < 4.8e247

    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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutative100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 1.08 \cdot 10^{+201}:\\ \;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+233} \lor \neg \left(z \leq 4.8 \cdot 10^{+247}\right):\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \mathbf{else}:\\ \;\;\;\;y + b \cdot \left(a - 0.5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 81.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;z \leq 3.7 \cdot 10^{+199}:\\ \;\;\;\;\left(x + y\right) + t\_1\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+235}:\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{+248}:\\ \;\;\;\;y + t\_1\\ \mathbf{else}:\\ \;\;\;\;z - z \cdot \log t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (- a 0.5))))
   (if (<= z 3.7e+199)
     (+ (+ x y) t_1)
     (if (<= z 9.5e+235)
       (* z (- 1.0 (log t)))
       (if (<= z 1.12e+248) (+ y t_1) (- z (* z (log t))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (a - 0.5);
	double tmp;
	if (z <= 3.7e+199) {
		tmp = (x + y) + t_1;
	} else if (z <= 9.5e+235) {
		tmp = z * (1.0 - log(t));
	} else if (z <= 1.12e+248) {
		tmp = y + t_1;
	} 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 = b * (a - 0.5d0)
    if (z <= 3.7d+199) then
        tmp = (x + y) + t_1
    else if (z <= 9.5d+235) then
        tmp = z * (1.0d0 - log(t))
    else if (z <= 1.12d+248) then
        tmp = y + t_1
    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 = b * (a - 0.5);
	double tmp;
	if (z <= 3.7e+199) {
		tmp = (x + y) + t_1;
	} else if (z <= 9.5e+235) {
		tmp = z * (1.0 - Math.log(t));
	} else if (z <= 1.12e+248) {
		tmp = y + t_1;
	} else {
		tmp = z - (z * Math.log(t));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (a - 0.5)
	tmp = 0
	if z <= 3.7e+199:
		tmp = (x + y) + t_1
	elif z <= 9.5e+235:
		tmp = z * (1.0 - math.log(t))
	elif z <= 1.12e+248:
		tmp = y + t_1
	else:
		tmp = z - (z * math.log(t))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(b * Float64(a - 0.5))
	tmp = 0.0
	if (z <= 3.7e+199)
		tmp = Float64(Float64(x + y) + t_1);
	elseif (z <= 9.5e+235)
		tmp = Float64(z * Float64(1.0 - log(t)));
	elseif (z <= 1.12e+248)
		tmp = Float64(y + t_1);
	else
		tmp = Float64(z - Float64(z * log(t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = b * (a - 0.5);
	tmp = 0.0;
	if (z <= 3.7e+199)
		tmp = (x + y) + t_1;
	elseif (z <= 9.5e+235)
		tmp = z * (1.0 - log(t));
	elseif (z <= 1.12e+248)
		tmp = y + t_1;
	else
		tmp = z - (z * log(t));
	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[z, 3.7e+199], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 9.5e+235], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.12e+248], N[(y + t$95$1), $MachinePrecision], N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 9.5 \cdot 10^{+235}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\

\mathbf{elif}\;z \leq 1.12 \cdot 10^{+248}:\\
\;\;\;\;y + t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < 3.70000000000000021e199

    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. Add Preprocessing
    3. Taylor expanded in z around 0 88.9%

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

    if 3.70000000000000021e199 < z < 9.49999999999999966e235

    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. Add Preprocessing
    3. Taylor expanded in y around inf 29.3%

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(\left(1 + \frac{x}{y}\right) + \left(\frac{z}{y} + \left(-\frac{z \cdot \log t}{y}\right)\right)\right)} + \left(a - 0.5\right) \cdot b \]
      4. sub-neg29.3%

        \[\leadsto y \cdot \left(\left(1 + \frac{x}{y}\right) + \color{blue}{\left(\frac{z}{y} - \frac{z \cdot \log t}{y}\right)}\right) + \left(a - 0.5\right) \cdot b \]
      5. div-sub29.9%

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

        \[\leadsto y \cdot \left(\left(1 + \frac{x}{y}\right) + \frac{\color{blue}{z \cdot 1} - z \cdot \log t}{y}\right) + \left(a - 0.5\right) \cdot b \]
      7. distribute-lft-out--29.9%

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

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

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

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

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

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

    if 9.49999999999999966e235 < z < 1.11999999999999992e248

    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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutative100.0%

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

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

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

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

    if 1.11999999999999992e248 < 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. Add Preprocessing
    3. Taylor expanded in y around 0 93.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 3.7 \cdot 10^{+199}:\\ \;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+235}:\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{+248}:\\ \;\;\;\;y + b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;z - z \cdot \log t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 84.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;x + y \leq 10^{+115}:\\ \;\;\;\;t\_1 + \left(\left(z + x\right) - z \cdot \log t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) + t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (- a 0.5))))
   (if (<= (+ x y) 1e+115) (+ t_1 (- (+ z x) (* z (log t)))) (+ (+ x 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 ((x + y) <= 1e+115) {
		tmp = t_1 + ((z + x) - (z * log(t)));
	} else {
		tmp = (x + 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 ((x + y) <= 1d+115) then
        tmp = t_1 + ((z + x) - (z * log(t)))
    else
        tmp = (x + 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 ((x + y) <= 1e+115) {
		tmp = t_1 + ((z + x) - (z * Math.log(t)));
	} else {
		tmp = (x + y) + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (a - 0.5)
	tmp = 0
	if (x + y) <= 1e+115:
		tmp = t_1 + ((z + x) - (z * math.log(t)))
	else:
		tmp = (x + 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(x + y) <= 1e+115)
		tmp = Float64(t_1 + Float64(Float64(z + x) - Float64(z * log(t))));
	else
		tmp = Float64(Float64(x + 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 ((x + y) <= 1e+115)
		tmp = t_1 + ((z + x) - (z * log(t)));
	else
		tmp = (x + 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[(x + y), $MachinePrecision], 1e+115], N[(t$95$1 + N[(N[(z + x), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + t\_1\\


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

    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. Add Preprocessing
    3. Taylor expanded in y around 0 82.8%

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

    if 1e115 < (+.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. Add Preprocessing
    3. Taylor expanded in z around 0 91.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + y \leq 10^{+115}:\\ \;\;\;\;b \cdot \left(a - 0.5\right) + \left(\left(z + x\right) - z \cdot \log t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 82.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.02 \cdot 10^{+201}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\

\mathbf{elif}\;z \leq 1.9 \cdot 10^{+222}:\\
\;\;\;\;\left(z \cdot b\right) \cdot \frac{1 - \log t}{b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < 1.02e201

    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. Add Preprocessing
    3. Taylor expanded in z around 0 88.9%

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

    if 1.02e201 < z < 1.90000000000000009e222

    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. Add Preprocessing
    3. Taylor expanded in y around inf 31.6%

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

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

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

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

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

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

        \[\leadsto y \cdot \left(\left(1 + \frac{x}{y}\right) + \frac{\color{blue}{z \cdot 1} - z \cdot \log t}{y}\right) + \left(a - 0.5\right) \cdot b \]
      7. distribute-lft-out--32.3%

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \left(\left(a + \frac{z \cdot \left(1 - \log t\right)}{b}\right) - 0.5\right)} \]
    8. Step-by-step derivation
      1. associate--l+71.8%

        \[\leadsto b \cdot \color{blue}{\left(a + \left(\frac{z \cdot \left(1 - \log t\right)}{b} - 0.5\right)\right)} \]
      2. associate-/l*71.4%

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

      \[\leadsto \color{blue}{b \cdot \left(a + \left(z \cdot \frac{1 - \log t}{b} - 0.5\right)\right)} \]
    10. Taylor expanded in z around inf 43.0%

      \[\leadsto \color{blue}{b \cdot \left(z \cdot \left(\frac{1}{b} - \frac{\log t}{b}\right)\right)} \]
    11. Step-by-step derivation
      1. div-sub43.0%

        \[\leadsto b \cdot \left(z \cdot \color{blue}{\frac{1 - \log t}{b}}\right) \]
      2. associate-*r*80.6%

        \[\leadsto \color{blue}{\left(b \cdot z\right) \cdot \frac{1 - \log t}{b}} \]
    12. Simplified80.6%

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

    if 1.90000000000000009e222 < 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. +-commutative99.7%

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

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(y + z \cdot \left(1 - \log t\right)\right)} \]
    6. Step-by-step derivation
      1. distribute-rgt-out--81.6%

        \[\leadsto x + \left(y + \color{blue}{\left(1 \cdot z - \log t \cdot z\right)}\right) \]
      2. *-un-lft-identity81.6%

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

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

        \[\leadsto x + \left(y + \color{blue}{\left(z + \left(-z \cdot \log t\right)\right)}\right) \]
      5. distribute-rgt-neg-in81.6%

        \[\leadsto x + \left(y + \left(z + \color{blue}{z \cdot \left(-\log t\right)}\right)\right) \]
    7. Applied egg-rr81.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 1.02 \cdot 10^{+201}:\\ \;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+222}:\\ \;\;\;\;\left(z \cdot b\right) \cdot \frac{1 - \log t}{b}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y + \left(z - z \cdot \log t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 82.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := 1 - \log t\\
\mathbf{if}\;z \leq 4.9 \cdot 10^{+200}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\

\mathbf{elif}\;z \leq 1.9 \cdot 10^{+222}:\\
\;\;\;\;\left(z \cdot b\right) \cdot \frac{t\_1}{b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < 4.89999999999999982e200

    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. Add Preprocessing
    3. Taylor expanded in z around 0 88.9%

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

    if 4.89999999999999982e200 < z < 1.90000000000000009e222

    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. Add Preprocessing
    3. Taylor expanded in y around inf 31.6%

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

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

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

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

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

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

        \[\leadsto y \cdot \left(\left(1 + \frac{x}{y}\right) + \frac{\color{blue}{z \cdot 1} - z \cdot \log t}{y}\right) + \left(a - 0.5\right) \cdot b \]
      7. distribute-lft-out--32.3%

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \left(\left(a + \frac{z \cdot \left(1 - \log t\right)}{b}\right) - 0.5\right)} \]
    8. Step-by-step derivation
      1. associate--l+71.8%

        \[\leadsto b \cdot \color{blue}{\left(a + \left(\frac{z \cdot \left(1 - \log t\right)}{b} - 0.5\right)\right)} \]
      2. associate-/l*71.4%

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

      \[\leadsto \color{blue}{b \cdot \left(a + \left(z \cdot \frac{1 - \log t}{b} - 0.5\right)\right)} \]
    10. Taylor expanded in z around inf 43.0%

      \[\leadsto \color{blue}{b \cdot \left(z \cdot \left(\frac{1}{b} - \frac{\log t}{b}\right)\right)} \]
    11. Step-by-step derivation
      1. div-sub43.0%

        \[\leadsto b \cdot \left(z \cdot \color{blue}{\frac{1 - \log t}{b}}\right) \]
      2. associate-*r*80.6%

        \[\leadsto \color{blue}{\left(b \cdot z\right) \cdot \frac{1 - \log t}{b}} \]
    12. Simplified80.6%

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

    if 1.90000000000000009e222 < 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. +-commutative99.7%

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

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 4.9 \cdot 10^{+200}:\\ \;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+222}:\\ \;\;\;\;\left(z \cdot b\right) \cdot \frac{1 - \log t}{b}\\ \mathbf{else}:\\ \;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 99.8% accurate, 1.0× speedup?

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

\\
\left(z + \left(\left(x + y\right) - z \cdot \log t\right)\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. Add Preprocessing
  3. Step-by-step derivation
    1. +-commutative99.9%

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

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

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

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

Alternative 13: 51.2% accurate, 3.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.3 \cdot 10^{+249}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{elif}\;b \leq -1.32 \cdot 10^{+127}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;b \leq 2.32 \cdot 10^{+64}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;b \leq 10^{+241}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;b \leq 3 \cdot 10^{+247}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 2.9 \cdot 10^{+279}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -2.3e+249)
   (* -0.5 b)
   (if (<= b -1.32e+127)
     (* a b)
     (if (<= b 2.32e+64)
       (+ x y)
       (if (<= b 1e+241)
         (* a b)
         (if (<= b 3e+247) x (if (<= b 2.9e+279) (* -0.5 b) (* a b))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -2.3e+249) {
		tmp = -0.5 * b;
	} else if (b <= -1.32e+127) {
		tmp = a * b;
	} else if (b <= 2.32e+64) {
		tmp = x + y;
	} else if (b <= 1e+241) {
		tmp = a * b;
	} else if (b <= 3e+247) {
		tmp = x;
	} else if (b <= 2.9e+279) {
		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 (b <= (-2.3d+249)) then
        tmp = (-0.5d0) * b
    else if (b <= (-1.32d+127)) then
        tmp = a * b
    else if (b <= 2.32d+64) then
        tmp = x + y
    else if (b <= 1d+241) then
        tmp = a * b
    else if (b <= 3d+247) then
        tmp = x
    else if (b <= 2.9d+279) 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 (b <= -2.3e+249) {
		tmp = -0.5 * b;
	} else if (b <= -1.32e+127) {
		tmp = a * b;
	} else if (b <= 2.32e+64) {
		tmp = x + y;
	} else if (b <= 1e+241) {
		tmp = a * b;
	} else if (b <= 3e+247) {
		tmp = x;
	} else if (b <= 2.9e+279) {
		tmp = -0.5 * b;
	} else {
		tmp = a * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if b <= -2.3e+249:
		tmp = -0.5 * b
	elif b <= -1.32e+127:
		tmp = a * b
	elif b <= 2.32e+64:
		tmp = x + y
	elif b <= 1e+241:
		tmp = a * b
	elif b <= 3e+247:
		tmp = x
	elif b <= 2.9e+279:
		tmp = -0.5 * b
	else:
		tmp = a * b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -2.3e+249)
		tmp = Float64(-0.5 * b);
	elseif (b <= -1.32e+127)
		tmp = Float64(a * b);
	elseif (b <= 2.32e+64)
		tmp = Float64(x + y);
	elseif (b <= 1e+241)
		tmp = Float64(a * b);
	elseif (b <= 3e+247)
		tmp = x;
	elseif (b <= 2.9e+279)
		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 (b <= -2.3e+249)
		tmp = -0.5 * b;
	elseif (b <= -1.32e+127)
		tmp = a * b;
	elseif (b <= 2.32e+64)
		tmp = x + y;
	elseif (b <= 1e+241)
		tmp = a * b;
	elseif (b <= 3e+247)
		tmp = x;
	elseif (b <= 2.9e+279)
		tmp = -0.5 * b;
	else
		tmp = a * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.3e+249], N[(-0.5 * b), $MachinePrecision], If[LessEqual[b, -1.32e+127], N[(a * b), $MachinePrecision], If[LessEqual[b, 2.32e+64], N[(x + y), $MachinePrecision], If[LessEqual[b, 1e+241], N[(a * b), $MachinePrecision], If[LessEqual[b, 3e+247], x, If[LessEqual[b, 2.9e+279], N[(-0.5 * b), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.3 \cdot 10^{+249}:\\
\;\;\;\;-0.5 \cdot b\\

\mathbf{elif}\;b \leq -1.32 \cdot 10^{+127}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;b \leq 2.32 \cdot 10^{+64}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;b \leq 10^{+241}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;b \leq 3 \cdot 10^{+247}:\\
\;\;\;\;x\\

\mathbf{elif}\;b \leq 2.9 \cdot 10^{+279}:\\
\;\;\;\;-0.5 \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -2.2999999999999998e249 or 3e247 < b < 2.89999999999999975e279

    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. +-commutative100.0%

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

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--100.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot b} \]
    7. Step-by-step derivation
      1. *-commutative63.4%

        \[\leadsto \color{blue}{b \cdot -0.5} \]
    8. Simplified63.4%

      \[\leadsto \color{blue}{b \cdot -0.5} \]

    if -2.2999999999999998e249 < b < -1.32000000000000005e127 or 2.3199999999999999e64 < b < 1.0000000000000001e241 or 2.89999999999999975e279 < 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. associate--l+99.9%

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{b \cdot a} \]
    7. Simplified50.9%

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

    if -1.32000000000000005e127 < b < 2.3199999999999999e64

    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. associate--l+99.9%

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.9%

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

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

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

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

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

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

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

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

    if 1.0000000000000001e241 < b < 3e247

    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. +-commutative99.7%

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

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification53.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.3 \cdot 10^{+249}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{elif}\;b \leq -1.32 \cdot 10^{+127}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;b \leq 2.32 \cdot 10^{+64}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;b \leq 10^{+241}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;b \leq 3 \cdot 10^{+247}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 2.9 \cdot 10^{+279}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 36.8% accurate, 3.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.06 \cdot 10^{+40}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \leq -1 \cdot 10^{-47}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{elif}\;a \leq -7.2 \cdot 10^{-102}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.25 \cdot 10^{-197}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{elif}\;a \leq 1.02 \cdot 10^{-95}:\\ \;\;\;\;y\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{-39}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -1.06e+40)
   (* a b)
   (if (<= a -1e-47)
     (* -0.5 b)
     (if (<= a -7.2e-102)
       x
       (if (<= a 1.25e-197)
         (* -0.5 b)
         (if (<= a 1.02e-95) y (if (<= a 2.5e-39) x (* a b))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -1.06e+40) {
		tmp = a * b;
	} else if (a <= -1e-47) {
		tmp = -0.5 * b;
	} else if (a <= -7.2e-102) {
		tmp = x;
	} else if (a <= 1.25e-197) {
		tmp = -0.5 * b;
	} else if (a <= 1.02e-95) {
		tmp = y;
	} else if (a <= 2.5e-39) {
		tmp = 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 <= (-1.06d+40)) then
        tmp = a * b
    else if (a <= (-1d-47)) then
        tmp = (-0.5d0) * b
    else if (a <= (-7.2d-102)) then
        tmp = x
    else if (a <= 1.25d-197) then
        tmp = (-0.5d0) * b
    else if (a <= 1.02d-95) then
        tmp = y
    else if (a <= 2.5d-39) then
        tmp = 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 <= -1.06e+40) {
		tmp = a * b;
	} else if (a <= -1e-47) {
		tmp = -0.5 * b;
	} else if (a <= -7.2e-102) {
		tmp = x;
	} else if (a <= 1.25e-197) {
		tmp = -0.5 * b;
	} else if (a <= 1.02e-95) {
		tmp = y;
	} else if (a <= 2.5e-39) {
		tmp = x;
	} else {
		tmp = a * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -1.06e+40:
		tmp = a * b
	elif a <= -1e-47:
		tmp = -0.5 * b
	elif a <= -7.2e-102:
		tmp = x
	elif a <= 1.25e-197:
		tmp = -0.5 * b
	elif a <= 1.02e-95:
		tmp = y
	elif a <= 2.5e-39:
		tmp = x
	else:
		tmp = a * b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -1.06e+40)
		tmp = Float64(a * b);
	elseif (a <= -1e-47)
		tmp = Float64(-0.5 * b);
	elseif (a <= -7.2e-102)
		tmp = x;
	elseif (a <= 1.25e-197)
		tmp = Float64(-0.5 * b);
	elseif (a <= 1.02e-95)
		tmp = y;
	elseif (a <= 2.5e-39)
		tmp = 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 <= -1.06e+40)
		tmp = a * b;
	elseif (a <= -1e-47)
		tmp = -0.5 * b;
	elseif (a <= -7.2e-102)
		tmp = x;
	elseif (a <= 1.25e-197)
		tmp = -0.5 * b;
	elseif (a <= 1.02e-95)
		tmp = y;
	elseif (a <= 2.5e-39)
		tmp = x;
	else
		tmp = a * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.06e+40], N[(a * b), $MachinePrecision], If[LessEqual[a, -1e-47], N[(-0.5 * b), $MachinePrecision], If[LessEqual[a, -7.2e-102], x, If[LessEqual[a, 1.25e-197], N[(-0.5 * b), $MachinePrecision], If[LessEqual[a, 1.02e-95], y, If[LessEqual[a, 2.5e-39], x, N[(a * b), $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;a \leq -7.2 \cdot 10^{-102}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.25 \cdot 10^{-197}:\\
\;\;\;\;-0.5 \cdot b\\

\mathbf{elif}\;a \leq 1.02 \cdot 10^{-95}:\\
\;\;\;\;y\\

\mathbf{elif}\;a \leq 2.5 \cdot 10^{-39}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.05999999999999996e40 or 2.4999999999999999e-39 < 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. +-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. associate--l+99.9%

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{b \cdot a} \]
    7. Simplified52.1%

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

    if -1.05999999999999996e40 < a < -9.9999999999999997e-48 or -7.2e-102 < a < 1.2500000000000001e-197

    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. associate--l+99.9%

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot b} \]
    7. Step-by-step derivation
      1. *-commutative43.5%

        \[\leadsto \color{blue}{b \cdot -0.5} \]
    8. Simplified43.5%

      \[\leadsto \color{blue}{b \cdot -0.5} \]

    if -9.9999999999999997e-48 < a < -7.2e-102 or 1.01999999999999995e-95 < a < 2.4999999999999999e-39

    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. +-commutative99.7%

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

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.7%

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

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

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

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

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

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

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

    if 1.2500000000000001e-197 < a < 1.01999999999999995e-95

    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. associate--l+99.9%

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{y} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification44.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.06 \cdot 10^{+40}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \leq -1 \cdot 10^{-47}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{elif}\;a \leq -7.2 \cdot 10^{-102}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.25 \cdot 10^{-197}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{elif}\;a \leq 1.02 \cdot 10^{-95}:\\ \;\;\;\;y\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{-39}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 62.5% accurate, 4.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + a \cdot b\\ t_2 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;b \leq -7.8 \cdot 10^{+64}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;b \leq -3.5 \cdot 10^{-12}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 4.1 \cdot 10^{-96}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;b \leq 4.1 \cdot 10^{+98}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* a b))) (t_2 (* b (- a 0.5))))
   (if (<= b -7.8e+64)
     t_2
     (if (<= b -3.5e-12)
       t_1
       (if (<= b 4.1e-96) (+ x y) (if (<= b 4.1e+98) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (a * b);
	double t_2 = b * (a - 0.5);
	double tmp;
	if (b <= -7.8e+64) {
		tmp = t_2;
	} else if (b <= -3.5e-12) {
		tmp = t_1;
	} else if (b <= 4.1e-96) {
		tmp = x + y;
	} else if (b <= 4.1e+98) {
		tmp = t_1;
	} 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 = x + (a * b)
    t_2 = b * (a - 0.5d0)
    if (b <= (-7.8d+64)) then
        tmp = t_2
    else if (b <= (-3.5d-12)) then
        tmp = t_1
    else if (b <= 4.1d-96) then
        tmp = x + y
    else if (b <= 4.1d+98) then
        tmp = t_1
    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 = x + (a * b);
	double t_2 = b * (a - 0.5);
	double tmp;
	if (b <= -7.8e+64) {
		tmp = t_2;
	} else if (b <= -3.5e-12) {
		tmp = t_1;
	} else if (b <= 4.1e-96) {
		tmp = x + y;
	} else if (b <= 4.1e+98) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (a * b)
	t_2 = b * (a - 0.5)
	tmp = 0
	if b <= -7.8e+64:
		tmp = t_2
	elif b <= -3.5e-12:
		tmp = t_1
	elif b <= 4.1e-96:
		tmp = x + y
	elif b <= 4.1e+98:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(a * b))
	t_2 = Float64(b * Float64(a - 0.5))
	tmp = 0.0
	if (b <= -7.8e+64)
		tmp = t_2;
	elseif (b <= -3.5e-12)
		tmp = t_1;
	elseif (b <= 4.1e-96)
		tmp = Float64(x + y);
	elseif (b <= 4.1e+98)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (a * b);
	t_2 = b * (a - 0.5);
	tmp = 0.0;
	if (b <= -7.8e+64)
		tmp = t_2;
	elseif (b <= -3.5e-12)
		tmp = t_1;
	elseif (b <= 4.1e-96)
		tmp = x + y;
	elseif (b <= 4.1e+98)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -7.8e+64], t$95$2, If[LessEqual[b, -3.5e-12], t$95$1, If[LessEqual[b, 4.1e-96], N[(x + y), $MachinePrecision], If[LessEqual[b, 4.1e+98], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + a \cdot b\\
t_2 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;b \leq -7.8 \cdot 10^{+64}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;b \leq -3.5 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 4.1 \cdot 10^{-96}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;b \leq 4.1 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -7.7999999999999996e64 or 4.1e98 < 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. associate--l+99.9%

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.9%

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

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

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

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

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

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

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

    if -7.7999999999999996e64 < b < -3.5e-12 or 4.10000000000000024e-96 < b < 4.1e98

    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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + \frac{b \cdot \left(a - 0.5\right)}{x}\right)} \]
    7. Taylor expanded in a around inf 46.7%

      \[\leadsto x \cdot \left(1 + \color{blue}{\frac{a \cdot b}{x}}\right) \]
    8. Taylor expanded in x around 0 50.2%

      \[\leadsto \color{blue}{x + a \cdot b} \]
    9. Step-by-step derivation
      1. *-commutative50.2%

        \[\leadsto x + \color{blue}{b \cdot a} \]
    10. Simplified50.2%

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

    if -3.5e-12 < b < 4.10000000000000024e-96

    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. associate--l+99.9%

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.8 \cdot 10^{+64}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;b \leq -3.5 \cdot 10^{-12}:\\ \;\;\;\;x + a \cdot b\\ \mathbf{elif}\;b \leq 4.1 \cdot 10^{-96}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;b \leq 4.1 \cdot 10^{+98}:\\ \;\;\;\;x + a \cdot b\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 56.1% accurate, 6.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -1 \cdot 10^{+79} \lor \neg \left(a - 0.5 \leq -0.5\right):\\
\;\;\;\;x + a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 a #s(literal 1/2 binary64)) < -9.99999999999999967e78 or -0.5 < (-.f64 a #s(literal 1/2 binary64))

    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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + \frac{b \cdot \left(a - 0.5\right)}{x}\right)} \]
    7. Taylor expanded in a around inf 63.0%

      \[\leadsto x \cdot \left(1 + \color{blue}{\frac{a \cdot b}{x}}\right) \]
    8. Taylor expanded in x around 0 70.4%

      \[\leadsto \color{blue}{x + a \cdot b} \]
    9. Step-by-step derivation
      1. *-commutative70.4%

        \[\leadsto x + \color{blue}{b \cdot a} \]
    10. Simplified70.4%

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

    if -9.99999999999999967e78 < (-.f64 a #s(literal 1/2 binary64)) < -0.5

    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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

      \[\leadsto y + \color{blue}{-0.5 \cdot b} \]
    7. Step-by-step derivation
      1. *-commutative97.2%

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

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

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

Alternative 17: 61.4% accurate, 7.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.1 \cdot 10^{+38} \lor \neg \left(b \leq 5.5 \cdot 10^{-25}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -4.1000000000000003e38 or 5.50000000000000004e-25 < 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. associate--l+99.9%

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.9%

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

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

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

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

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

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

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

    if -4.1000000000000003e38 < b < 5.50000000000000004e-25

    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. associate--l+99.9%

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.1 \cdot 10^{+38} \lor \neg \left(b \leq 5.5 \cdot 10^{-25}\right):\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 58.7% accurate, 8.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;x + y \leq -400000:\\ \;\;\;\;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 (<= (+ x y) -400000.0) (+ 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 ((x + y) <= -400000.0) {
		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 ((x + y) <= (-400000.0d0)) 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 ((x + y) <= -400000.0) {
		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 (x + y) <= -400000.0:
		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(x + y) <= -400000.0)
		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 ((x + y) <= -400000.0)
		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[(x + y), $MachinePrecision], -400000.0], 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}\;x + y \leq -400000:\\
\;\;\;\;x + t\_1\\

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

    if -4e5 < (+.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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + y \leq -400000:\\ \;\;\;\;x + b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y + b \cdot \left(a - 0.5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 53.0% accurate, 8.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x + y \leq 10^{+105}:\\ \;\;\;\;x + 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 (<= (+ x y) 1e+105) (+ x (* 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 ((x + y) <= 1e+105) {
		tmp = x + (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 ((x + y) <= 1d+105) then
        tmp = x + (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 ((x + y) <= 1e+105) {
		tmp = x + (b * (a - 0.5));
	} else {
		tmp = y + (-0.5 * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (x + y) <= 1e+105:
		tmp = x + (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(x + y) <= 1e+105)
		tmp = Float64(x + 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 ((x + y) <= 1e+105)
		tmp = x + (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[(x + y), $MachinePrecision], 1e+105], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

    if 9.9999999999999994e104 < (+.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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

      \[\leadsto y + \color{blue}{-0.5 \cdot b} \]
    7. Step-by-step derivation
      1. *-commutative73.0%

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

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

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

Alternative 20: 26.4% accurate, 8.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+123}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq -2.9 \cdot 10^{-80}:\\
\;\;\;\;-0.5 \cdot b\\

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


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

    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. +-commutative100.0%

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

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--100.0%

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

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

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

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

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

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

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

    if -2.49999999999999987e123 < x < -2.89999999999999998e-80

    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. +-commutative99.8%

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

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot b} \]
    7. Step-by-step derivation
      1. *-commutative26.3%

        \[\leadsto \color{blue}{b \cdot -0.5} \]
    8. Simplified26.3%

      \[\leadsto \color{blue}{b \cdot -0.5} \]

    if -2.89999999999999998e-80 < 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. +-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. associate--l+99.9%

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification27.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{+123}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -2.9 \cdot 10^{-80}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 79.0% accurate, 12.8× speedup?

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

\\
\left(x + y\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. Add Preprocessing
  3. Taylor expanded in z around 0 82.4%

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

    \[\leadsto \left(x + y\right) + b \cdot \left(a - 0.5\right) \]
  5. Add Preprocessing

Alternative 22: 27.7% accurate, 19.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+155}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.60000000000000007e155

    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. +-commutative100.0%

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

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.9%

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

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

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

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

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

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

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

    if -3.60000000000000007e155 < 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. +-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. associate--l+99.9%

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.9%

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

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

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

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

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

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

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

Alternative 23: 22.0% 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. +-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. associate--l+99.9%

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

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

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

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

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

      \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
    8. distribute-rgt-out--99.9%

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

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

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

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

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

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

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

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 2024107 
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
  :precision binary64

  :alt
  (+ (+ (+ 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)))