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

Percentage Accurate: 99.9% → 99.9%
Time: 11.7s
Alternatives: 16
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 16 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.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.6% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -3.99999999999999978e-20 or 2e53 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)

    1. Initial program 100.0%

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

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

    if -3.99999999999999978e-20 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2e53

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 84.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := z - z \cdot \log t\\
t_2 := y + t\_1\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+168}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq 1.05 \cdot 10^{+171}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 2.2 \cdot 10^{+222}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a \cdot \left(1 + \frac{-0.5}{a}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.8e168 or 5.6000000000000002e138 < z < 1.0500000000000001e171

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

    if -1.8e168 < z < 5.6000000000000002e138

    1. Initial program 99.9%

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

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

    if 1.0500000000000001e171 < z < 2.2000000000000001e222

    1. Initial program 99.9%

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

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

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

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

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

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

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

        \[\leadsto \left(x + y\right) + b \cdot \left(a \cdot \color{blue}{\left(1 + \left(-0.5 \cdot \frac{1}{a}\right)\right)}\right) \]
      5. associate-*r/66.0%

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

        \[\leadsto \left(x + y\right) + b \cdot \left(a \cdot \left(1 + \left(-\frac{\color{blue}{0.5}}{a}\right)\right)\right) \]
      7. distribute-neg-frac66.0%

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

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

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

    if 2.2000000000000001e222 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

Alternative 4: 85.2% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

    if -3.20000000000000014e94 < 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 x around 0 87.6%

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

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

Alternative 5: 85.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+168}:\\
\;\;\;\;y + \left(z - z \cdot \log t\right)\\

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

    if -1.9000000000000001e168 < z < 5.6000000000000005e157

    1. Initial program 99.9%

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

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

    if 5.6000000000000005e157 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 84.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+168} \lor \neg \left(z \leq 6.9 \cdot 10^{+221}\right):\\
\;\;\;\;z - z \cdot \log t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.1999999999999999e168 or 6.9e221 < z

    1. Initial program 99.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{z - z \cdot \log t} \]

    if -7.1999999999999999e168 < z < 6.9e221

    1. Initial program 99.9%

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

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

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

Alternative 7: 99.9% 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 8: 69.6% accurate, 4.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+14} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+53}\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 -4e+14) (not (<= t_1 2e+53))) (+ 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 <= -4e+14) || !(t_1 <= 2e+53)) {
		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 <= (-4d+14)) .or. (.not. (t_1 <= 2d+53))) 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 <= -4e+14) || !(t_1 <= 2e+53)) {
		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 <= -4e+14) or not (t_1 <= 2e+53):
		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 <= -4e+14) || !(t_1 <= 2e+53))
		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 <= -4e+14) || ~((t_1 <= 2e+53)))
		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, -4e+14], N[Not[LessEqual[t$95$1, 2e+53]], $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 -4 \cdot 10^{+14} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+53}\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) < -4e14 or 2e53 < (*.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 78.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4e14 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2e53

    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 0 60.8%

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

      \[\leadsto \left(x + y\right) + \color{blue}{-0.5 \cdot b} \]
    5. Step-by-step derivation
      1. *-commutative58.0%

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    9. Simplified57.0%

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

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

Alternative 9: 43.4% accurate, 6.4× speedup?

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

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

\mathbf{elif}\;a \leq -2.4 \cdot 10^{-303}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;a \leq 0.5:\\
\;\;\;\;-0.5 \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.3e15 or 0.5 < a

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3e15 < a < -2.4000000000000001e-303

    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 0 67.4%

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

      \[\leadsto \left(x + y\right) + \color{blue}{-0.5 \cdot b} \]
    5. Step-by-step derivation
      1. *-commutative65.9%

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    9. Simplified49.2%

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

    if -2.4000000000000001e-303 < a < 0.5

    1. Initial program 99.9%

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

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

      \[\leadsto \left(x + y\right) + \color{blue}{-0.5 \cdot b} \]
    5. Step-by-step derivation
      1. *-commutative74.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.3 \cdot 10^{+15}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \leq -2.4 \cdot 10^{-303}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;a \leq 0.5:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 37.5% accurate, 6.4× speedup?

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

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

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

\mathbf{elif}\;a \leq 0.5:\\
\;\;\;\;-0.5 \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.15e15 or 0.5 < a

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.15e15 < a < -9.00000000000000006e-299

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

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

    if -9.00000000000000006e-299 < a < 0.5

    1. Initial program 99.9%

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

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

      \[\leadsto \left(x + y\right) + \color{blue}{-0.5 \cdot b} \]
    5. Step-by-step derivation
      1. *-commutative74.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.15 \cdot 10^{+15}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \leq -9 \cdot 10^{-299}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 0.5:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 26.0% accurate, 6.4× speedup?

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

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

\mathbf{elif}\;x \leq -8 \cdot 10^{-145}:\\
\;\;\;\;y\\

\mathbf{elif}\;x \leq 1.18 \cdot 10^{-306}:\\
\;\;\;\;-0.5 \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.40000000000000019e-31

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.40000000000000019e-31 < x < -7.99999999999999932e-145 or 1.17999999999999999e-306 < x

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.99999999999999932e-145 < x < 1.17999999999999999e-306

    1. Initial program 99.7%

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot b} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 12: 61.3% accurate, 7.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.1 \cdot 10^{+24} \lor \neg \left(b \leq 2700000000\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 < -2.1000000000000001e24 or 2.7e9 < b

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1000000000000001e24 < b < 2.7e9

    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 0 67.1%

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

      \[\leadsto \left(x + y\right) + \color{blue}{-0.5 \cdot b} \]
    5. Step-by-step derivation
      1. *-commutative55.0%

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    9. Simplified54.2%

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

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

Alternative 13: 57.9% accurate, 8.2× speedup?

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

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


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

    1. Initial program 100.0%

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

      \[\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+75.5%

        \[\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+75.5%

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999933e-125 < (+.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.1%

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

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

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

Alternative 14: 78.8% accurate, 12.8× speedup?

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

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

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

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

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

Alternative 15: 27.6% accurate, 19.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.000000000000001e-30

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.000000000000001e-30 < x

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 22.6% 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 19.7%

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

Developer target: 99.6% accurate, 0.4× speedup?

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

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

Reproduce

?
herbie shell --seed 2024087 
(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)))