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

Percentage Accurate: 99.8% → 99.9%
Time: 13.0s
Alternatives: 18
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 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. Final simplification99.9%

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

Alternative 2: 90.7% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -9.99999999999999983e76

    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 inf 63.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - 0.5\right)\right)} \]
    7. Step-by-step derivation
      1. associate-+r+95.1%

        \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - 0.5\right)} \]
      2. sub-neg95.1%

        \[\leadsto \left(x + y\right) + b \cdot \color{blue}{\left(a + \left(-0.5\right)\right)} \]
      3. metadata-eval95.1%

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

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

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

    if -9.99999999999999983e76 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 9.99999999999999991e131

    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.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 93.0%

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

    if 9.99999999999999991e131 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) 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. Add Preprocessing
    3. Taylor expanded in z around inf 73.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - 0.5\right)\right)} \]
    7. Step-by-step derivation
      1. associate-+r+88.8%

        \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - 0.5\right)} \]
      2. sub-neg88.8%

        \[\leadsto \left(x + y\right) + b \cdot \color{blue}{\left(a + \left(-0.5\right)\right)} \]
      3. metadata-eval88.8%

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

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

      \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(-0.5 + a\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-in88.8%

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

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

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

        \[\leadsto \left(x + y\right) + \left(b \cdot a + \color{blue}{b \cdot -0.5}\right) \]
    10. Applied egg-rr88.8%

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

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

Alternative 3: 76.0% accurate, 1.0× speedup?

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

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


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

    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 x around inf 77.2%

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

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

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

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

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

    if -4.99999999999999962e125 < (+.f64 x y)

    1. Initial program 99.8%

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

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

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

Alternative 4: 78.6% accurate, 1.0× speedup?

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

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

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


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

    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 72.7%

      \[\leadsto \color{blue}{\left(x + \left(z + b \cdot \left(a - 0.5\right)\right)\right) - z \cdot \log t} \]
    4. Step-by-step derivation
      1. associate-+r+72.7%

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

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

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

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

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

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

    if -1.99999999999999989e-20 < (+.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 x around 0 83.9%

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

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

Alternative 5: 85.4% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 99.5%

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

        \[\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.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 x around inf 70.7%

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

    if -3.0000000000000001e206 < z < 1.5000000000000002e194

    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 inf 63.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - 0.5\right)\right)} \]
    7. Step-by-step derivation
      1. associate-+r+90.6%

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

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

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

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

      \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(-0.5 + a\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-in90.6%

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

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

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

        \[\leadsto \left(x + y\right) + \left(b \cdot a + \color{blue}{b \cdot -0.5}\right) \]
    10. Applied egg-rr90.6%

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

    if 1.5000000000000002e194 < z

    1. Initial program 99.5%

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

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

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

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

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

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

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

        \[\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 b around inf 89.5%

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

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

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

Alternative 6: 85.9% accurate, 1.0× speedup?

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

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

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

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


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

    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.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 68.2%

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

        \[\leadsto z \cdot \left(1 - \log t\right) + \color{blue}{b \cdot a} \]
    7. Simplified68.2%

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

    if -1.1600000000000001e103 < z < 7.80000000000000031e194

    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 inf 60.2%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - 0.5\right)\right)} \]
    7. Step-by-step derivation
      1. associate-+r+93.3%

        \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - 0.5\right)} \]
      2. sub-neg93.3%

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

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

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

      \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(-0.5 + a\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-in93.3%

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

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

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

        \[\leadsto \left(x + y\right) + \left(b \cdot a + \color{blue}{b \cdot -0.5}\right) \]
    10. Applied egg-rr93.3%

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

    if 7.80000000000000031e194 < z

    1. Initial program 99.5%

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

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

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

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

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

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

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

        \[\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 b around inf 89.5%

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

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

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

Alternative 7: 85.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+208} \lor \neg \left(z \leq 1.35 \cdot 10^{+195}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.5000000000000001e208 or 1.3500000000000001e195 < z

    1. Initial program 99.5%

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

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

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

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

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

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

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

        \[\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 x around inf 74.3%

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

    if -6.5000000000000001e208 < z < 1.3500000000000001e195

    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 inf 63.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - 0.5\right)\right)} \]
    7. Step-by-step derivation
      1. associate-+r+90.6%

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

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

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

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

      \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(-0.5 + a\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-in90.6%

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

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

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

        \[\leadsto \left(x + y\right) + \left(b \cdot a + \color{blue}{b \cdot -0.5}\right) \]
    10. Applied egg-rr90.6%

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

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

Alternative 8: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(z + \left(x + y\right)\right) - z \cdot \log t\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(Float64(z + 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[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(z + \left(x + y\right)\right) - z \cdot \log t\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. Final simplification99.9%

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

Alternative 9: 82.0% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 2.10000000000000016e194

    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 inf 67.3%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - 0.5\right)\right)} \]
    7. Step-by-step derivation
      1. associate-+r+85.9%

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

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

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

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

      \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(-0.5 + a\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-in85.9%

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

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

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

        \[\leadsto \left(x + y\right) + \left(b \cdot a + \color{blue}{b \cdot -0.5}\right) \]
    10. Applied egg-rr85.9%

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

    if 2.10000000000000016e194 < z

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 69.3% accurate, 4.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -2e22 or 4.99999999999999991e76 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) 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. Add Preprocessing
    3. Taylor expanded in x around inf 77.7%

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

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

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

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

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

    if -2e22 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 4.99999999999999991e76

    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 z around inf 69.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - 0.5\right)\right)} \]
    7. Step-by-step derivation
      1. associate-+r+74.3%

        \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - 0.5\right)} \]
      2. sub-neg74.3%

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

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

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

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

      \[\leadsto \color{blue}{x + y} \]
    10. Step-by-step derivation
      1. +-commutative72.0%

        \[\leadsto \color{blue}{y + x} \]
    11. Simplified72.0%

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

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

Alternative 11: 61.3% accurate, 7.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -35000000000000 \lor \neg \left(b \leq 1.2 \cdot 10^{+32}\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 -35000000000000.0) (not (<= b 1.2e+32)))
   (* b (- a 0.5))
   (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((b <= -35000000000000.0) || !(b <= 1.2e+32)) {
		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 <= (-35000000000000.0d0)) .or. (.not. (b <= 1.2d+32))) 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 <= -35000000000000.0) || !(b <= 1.2e+32)) {
		tmp = b * (a - 0.5);
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (b <= -35000000000000.0) or not (b <= 1.2e+32):
		tmp = b * (a - 0.5)
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((b <= -35000000000000.0) || !(b <= 1.2e+32))
		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 <= -35000000000000.0) || ~((b <= 1.2e+32)))
		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, -35000000000000.0], N[Not[LessEqual[b, 1.2e+32]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -35000000000000 \lor \neg \left(b \leq 1.2 \cdot 10^{+32}\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 < -3.5e13 or 1.19999999999999996e32 < 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. Add Preprocessing
    3. Taylor expanded in z around inf 68.7%

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

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

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

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

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

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

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

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

    if -3.5e13 < b < 1.19999999999999996e32

    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 z around inf 71.4%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - 0.5\right)\right)} \]
    7. Step-by-step derivation
      1. associate-+r+74.5%

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

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

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

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

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

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

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

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

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

Alternative 12: 58.1% accurate, 8.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;x + y \leq 5 \cdot 10^{-145}:\\ \;\;\;\;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) 5e-145) (+ 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) <= 5e-145) {
		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) <= 5d-145) 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) <= 5e-145) {
		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) <= 5e-145:
		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) <= 5e-145)
		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) <= 5e-145)
		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], 5e-145], 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 5 \cdot 10^{-145}:\\
\;\;\;\;x + t\_1\\

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


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

    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 x around inf 77.3%

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

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

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

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

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

    if 4.9999999999999998e-145 < (+.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 x around inf 83.8%

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

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

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

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

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

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

Alternative 13: 52.4% accurate, 8.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.6 \cdot 10^{+58} \lor \neg \left(a \leq 4.6 \cdot 10^{+114}\right):\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.59999999999999966e58 or 4.6000000000000001e114 < 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. Add Preprocessing
    3. Taylor expanded in z around inf 73.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - 0.5\right)\right)} \]
    7. Step-by-step derivation
      1. associate-+r+89.3%

        \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - 0.5\right)} \]
      2. sub-neg89.3%

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

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

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

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

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

        \[\leadsto \color{blue}{b \cdot a} \]
    11. Simplified65.9%

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

    if -6.59999999999999966e58 < a < 4.6000000000000001e114

    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 z around inf 68.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - 0.5\right)\right)} \]
    7. Step-by-step derivation
      1. associate-+r+75.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    11. Simplified54.4%

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

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

Alternative 14: 28.9% accurate, 8.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.95 \cdot 10^{-145}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 2.9 \cdot 10^{+206}:\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 1.95000000000000015e-145

    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 42.6%

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

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

    if 1.95000000000000015e-145 < y < 2.9e206

    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 z around inf 75.4%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - 0.5\right)\right)} \]
    7. Step-by-step derivation
      1. associate-+r+81.8%

        \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - 0.5\right)} \]
      2. sub-neg81.8%

        \[\leadsto \left(x + y\right) + b \cdot \color{blue}{\left(a + \left(-0.5\right)\right)} \]
      3. metadata-eval81.8%

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

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

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

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

        \[\leadsto \color{blue}{b \cdot a} \]
    11. Simplified38.2%

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

    if 2.9e206 < 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 inf 60.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.95 \cdot 10^{-145}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{+206}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 79.0% accurate, 10.5× speedup?

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

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

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Add Preprocessing
  3. Taylor expanded in z around inf 70.1%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - 0.5\right)\right)} \]
  7. Step-by-step derivation
    1. associate-+r+80.7%

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

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

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

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

    \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(-0.5 + a\right)} \]
  9. Step-by-step derivation
    1. distribute-rgt-in80.7%

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

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

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

      \[\leadsto \left(x + y\right) + \left(b \cdot a + \color{blue}{b \cdot -0.5}\right) \]
  10. Applied egg-rr80.7%

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

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

Alternative 16: 79.0% accurate, 12.8× speedup?

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

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

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Add Preprocessing
  3. Taylor expanded in z around inf 70.1%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - 0.5\right)\right)} \]
  7. Step-by-step derivation
    1. associate-+r+80.7%

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

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

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

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

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

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

Alternative 17: 28.8% accurate, 19.1× speedup?

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

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

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


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

    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.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 58.1%

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

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

    if -2.15e14 < 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. Add Preprocessing
    3. Taylor expanded in z around inf 72.2%

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

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

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

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

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

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

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

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

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

Alternative 18: 21.4% 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 39.4%

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

    \[\leadsto \color{blue}{x} \]
  7. Final simplification20.8%

    \[\leadsto x \]
  8. Add Preprocessing

Developer target: 99.4% 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 2024078 
(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)))