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

Percentage Accurate: 99.8% → 99.8%
Time: 16.3s
Alternatives: 17
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 17 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.5× speedup?

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

\\
\mathsf{fma}\left(a + -0.5, b, x + \left(y + \left(z - z \cdot \log t\right)\right)\right)
\end{array}
Derivation
  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. fma-def99.8%

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

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

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

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

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

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

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

Alternative 2: 88.3% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -3.7999999999999998e-66

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.7999999999999998e-66 < b < 5.5e72

    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. remove-double-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

    if 5.5e72 < b

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.8 \cdot 10^{-66}:\\ \;\;\;\;y + \left(\left(x + z\right) - b \cdot \left(0.5 - a\right)\right)\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{+72}:\\ \;\;\;\;\left(\left(z - z \cdot \log t\right) + \left(x + y\right)\right) + -0.5 \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\ \end{array} \]

Alternative 3: 82.3% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e-13 < (+.f64 x y)

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.8% accurate, 1.0× speedup?

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

\\
\left(\left(z - z \cdot \log t\right) + \left(x + y\right)\right) + \left(a + -0.5\right) \cdot b
\end{array}
Derivation
  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. remove-double-neg99.8%

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

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

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

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

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

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

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

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

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

Alternative 5: 88.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -7.8 \cdot 10^{-66}:\\ \;\;\;\;y + \left(\left(x + z\right) - b \cdot \left(0.5 - a\right)\right)\\ \mathbf{elif}\;b \leq 1.2 \cdot 10^{-33}:\\ \;\;\;\;x + \left(\left(y + z\right) - z \cdot \log t\right)\\ \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 (<= b -7.8e-66)
   (+ y (- (+ x z) (* b (- 0.5 a))))
   (if (<= b 1.2e-33)
     (+ x (- (+ y 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 (b <= -7.8e-66) {
		tmp = y + ((x + z) - (b * (0.5 - a)));
	} else if (b <= 1.2e-33) {
		tmp = x + ((y + 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 (b <= (-7.8d-66)) then
        tmp = y + ((x + z) - (b * (0.5d0 - a)))
    else if (b <= 1.2d-33) then
        tmp = x + ((y + 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 (b <= -7.8e-66) {
		tmp = y + ((x + z) - (b * (0.5 - a)));
	} else if (b <= 1.2e-33) {
		tmp = x + ((y + 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 b <= -7.8e-66:
		tmp = y + ((x + z) - (b * (0.5 - a)))
	elif b <= 1.2e-33:
		tmp = x + ((y + 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 (b <= -7.8e-66)
		tmp = Float64(y + Float64(Float64(x + z) - Float64(b * Float64(0.5 - a))));
	elseif (b <= 1.2e-33)
		tmp = Float64(x + Float64(Float64(y + 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 (b <= -7.8e-66)
		tmp = y + ((x + z) - (b * (0.5 - a)));
	elseif (b <= 1.2e-33)
		tmp = x + ((y + 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[LessEqual[b, -7.8e-66], N[(y + N[(N[(x + z), $MachinePrecision] - N[(b * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.2e-33], N[(x + N[(N[(y + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $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}\;b \leq -7.8 \cdot 10^{-66}:\\
\;\;\;\;y + \left(\left(x + z\right) - b \cdot \left(0.5 - a\right)\right)\\

\mathbf{elif}\;b \leq 1.2 \cdot 10^{-33}:\\
\;\;\;\;x + \left(\left(y + z\right) - z \cdot \log t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -7.79999999999999965e-66

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.79999999999999965e-66 < b < 1.2e-33

    1. Initial program 99.7%

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

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

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

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

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

        \[\leadsto y + \left(\left(x + z\right) - \color{blue}{\mathsf{fma}\left(z, \log t, -\left(a - 0.5\right) \cdot b\right)}\right) \]
      6. distribute-lft-neg-in99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2e-33 < b

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.8 \cdot 10^{-66}:\\ \;\;\;\;y + \left(\left(x + z\right) - b \cdot \left(0.5 - a\right)\right)\\ \mathbf{elif}\;b \leq 1.2 \cdot 10^{-33}:\\ \;\;\;\;x + \left(\left(y + z\right) - z \cdot \log t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\ \end{array} \]

Alternative 6: 85.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+186} \lor \neg \left(z \leq 4 \cdot 10^{+155}\right):\\
\;\;\;\;y + z \cdot \left(1 - \log t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.3499999999999999e186 or 4.00000000000000003e155 < z

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3499999999999999e186 < z < 4.00000000000000003e155

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 83.3% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+190} \lor \neg \left(z \leq 7.8 \cdot 10^{+155}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7e190 or 7.7999999999999996e155 < z

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

    if -1.7e190 < z < 7.7999999999999996e155

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 30.4% accurate, 10.2× speedup?

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

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

\mathbf{elif}\;y \leq -6.5 \cdot 10^{-134}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;y \leq -8.8 \cdot 10^{-219}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{+94}:\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.65e-102 or -6.4999999999999998e-134 < y < -8.7999999999999998e-219

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

    if -1.65e-102 < y < -6.4999999999999998e-134 or -8.7999999999999998e-219 < y < 1.3e94

    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. fma-def99.8%

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

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

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

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

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

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

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

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

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

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

    if 1.3e94 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{-102}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-134}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;y \leq -8.8 \cdot 10^{-219}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+94}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 9: 61.6% accurate, 10.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;b \leq -5.6 \cdot 10^{+194}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -7.2 \cdot 10^{+49}:\\ \;\;\;\;y + a \cdot b\\ \mathbf{elif}\;b \leq 2.2 \cdot 10^{+88}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (- a 0.5))))
   (if (<= b -5.6e+194)
     t_1
     (if (<= b -7.2e+49) (+ y (* a b)) (if (<= b 2.2e+88) (+ x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (a - 0.5);
	double tmp;
	if (b <= -5.6e+194) {
		tmp = t_1;
	} else if (b <= -7.2e+49) {
		tmp = y + (a * b);
	} else if (b <= 2.2e+88) {
		tmp = x + y;
	} 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) :: tmp
    t_1 = b * (a - 0.5d0)
    if (b <= (-5.6d+194)) then
        tmp = t_1
    else if (b <= (-7.2d+49)) then
        tmp = y + (a * b)
    else if (b <= 2.2d+88) then
        tmp = x + y
    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 = b * (a - 0.5);
	double tmp;
	if (b <= -5.6e+194) {
		tmp = t_1;
	} else if (b <= -7.2e+49) {
		tmp = y + (a * b);
	} else if (b <= 2.2e+88) {
		tmp = x + y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (a - 0.5)
	tmp = 0
	if b <= -5.6e+194:
		tmp = t_1
	elif b <= -7.2e+49:
		tmp = y + (a * b)
	elif b <= 2.2e+88:
		tmp = x + y
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(b * Float64(a - 0.5))
	tmp = 0.0
	if (b <= -5.6e+194)
		tmp = t_1;
	elseif (b <= -7.2e+49)
		tmp = Float64(y + Float64(a * b));
	elseif (b <= 2.2e+88)
		tmp = Float64(x + y);
	else
		tmp = 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 (b <= -5.6e+194)
		tmp = t_1;
	elseif (b <= -7.2e+49)
		tmp = y + (a * b);
	elseif (b <= 2.2e+88)
		tmp = x + y;
	else
		tmp = 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[b, -5.6e+194], t$95$1, If[LessEqual[b, -7.2e+49], N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.2e+88], N[(x + y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq -7.2 \cdot 10^{+49}:\\
\;\;\;\;y + a \cdot b\\

\mathbf{elif}\;b \leq 2.2 \cdot 10^{+88}:\\
\;\;\;\;x + y\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -5.60000000000000021e194 or 2.20000000000000009e88 < b

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

    if -5.60000000000000021e194 < b < -7.19999999999999993e49

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto y + \left(\left(x + z\right) - \color{blue}{\mathsf{fma}\left(z, \log t, -\left(a - 0.5\right) \cdot b\right)}\right) \]
      6. distribute-lft-neg-in99.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto y + \color{blue}{a \cdot b} \]
    5. Step-by-step derivation
      1. *-commutative74.5%

        \[\leadsto y + \color{blue}{b \cdot a} \]
    6. Simplified74.5%

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

    if -7.19999999999999993e49 < b < 2.20000000000000009e88

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto y + \left(\left(x + z\right) - \color{blue}{\mathsf{fma}\left(z, \log t, -\left(a - 0.5\right) \cdot b\right)}\right) \]
      6. distribute-lft-neg-in99.8%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.6 \cdot 10^{+194}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;b \leq -7.2 \cdot 10^{+49}:\\ \;\;\;\;y + a \cdot b\\ \mathbf{elif}\;b \leq 2.2 \cdot 10^{+88}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \end{array} \]

Alternative 10: 79.3% accurate, 10.5× speedup?

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

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

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

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

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

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

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

      \[\leadsto y + \left(\left(x + z\right) - \color{blue}{\mathsf{fma}\left(z, \log t, -\left(a - 0.5\right) \cdot b\right)}\right) \]
    6. distribute-lft-neg-in99.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 61.8% accurate, 12.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.75 \cdot 10^{+50} \lor \neg \left(b \leq 1.15 \cdot 10^{+88}\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 < -1.75000000000000003e50 or 1.1500000000000001e88 < b

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

    if -1.75000000000000003e50 < b < 1.1500000000000001e88

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto y + \left(\left(x + z\right) - \color{blue}{\mathsf{fma}\left(z, \log t, -\left(a - 0.5\right) \cdot b\right)}\right) \]
      6. distribute-lft-neg-in99.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 63.2% accurate, 12.7× speedup?

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

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

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


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

    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. fma-def99.8%

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

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

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

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

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

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

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

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

    if 3.90000000000000011e92 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y + \color{blue}{a \cdot b} \]
    5. Step-by-step derivation
      1. *-commutative63.2%

        \[\leadsto y + \color{blue}{b \cdot a} \]
    6. Simplified63.2%

      \[\leadsto y + \color{blue}{b \cdot a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification63.6%

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

Alternative 13: 62.5% accurate, 12.7× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

    if -1.15e-69 < x

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto y + \left(\left(x + z\right) - \color{blue}{\mathsf{fma}\left(z, \log t, -\left(a - 0.5\right) \cdot b\right)}\right) \]
      6. distribute-lft-neg-in99.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 78.6% 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.8%

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

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

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

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

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

      \[\leadsto y + \left(\left(x + z\right) - \color{blue}{\mathsf{fma}\left(z, \log t, -\left(a - 0.5\right) \cdot b\right)}\right) \]
    6. distribute-lft-neg-in99.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 51.3% accurate, 16.1× speedup?

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

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

\mathbf{elif}\;a \leq 320:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.99999999999999998e63 or 320 < a

    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. fma-def99.8%

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

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

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

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

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

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

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

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

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

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

    if -5.99999999999999998e63 < a < 320

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto y + \left(\left(x + z\right) - \color{blue}{\mathsf{fma}\left(z, \log t, -\left(a - 0.5\right) \cdot b\right)}\right) \]
      6. distribute-lft-neg-in99.8%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6 \cdot 10^{+63}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \leq 320:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]

Alternative 16: 27.3% accurate, 37.6× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

    if -1.15e-69 < x

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto y + \left(\left(x + z\right) - \color{blue}{\mathsf{fma}\left(z, \log t, -\left(a - 0.5\right) \cdot b\right)}\right) \]
      6. distribute-lft-neg-in99.8%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{-69}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 17: 22.3% accurate, 115.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
def code(x, y, z, t, a, b):
	return x
function code(x, y, z, t, a, b)
	return x
end
function tmp = code(x, y, z, t, a, b)
	tmp = x;
end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 99.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. fma-def99.8%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  7. Final simplification23.6%

    \[\leadsto x \]

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

  :herbie-target
  (+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))

  (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))