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

Percentage Accurate: 99.9% → 99.9%
Time: 10.9s
Alternatives: 19
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 19 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 91.3% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;a - 0.5 \leq -0.4:\\
\;\;\;\;\left(x + \left(y + \left(z + -0.5 \cdot b\right)\right)\right) - z \cdot \log t\\

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


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

    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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.9%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(y + \color{blue}{b \cdot a}\right) \]
    9. Simplified89.1%

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

    if -1.00000000000000004e42 < (-.f64 a #s(literal 1/2 binary64)) < -0.40000000000000002

    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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.9%

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

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

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

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

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

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

    if -0.40000000000000002 < (-.f64 a #s(literal 1/2 binary64))

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. 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.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 87.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+183} \lor \neg \left(z \leq 8 \cdot 10^{+73}\right):\\
\;\;\;\;\left(a + -0.5\right) \cdot b + \left(z - z \cdot \log t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.45e183 or 7.99999999999999986e73 < 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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.6%

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

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

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

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

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

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

    if -1.45e183 < z < 7.99999999999999986e73

    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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.9%

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

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

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

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

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

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

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

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

Alternative 4: 86.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+183} \lor \neg \left(z \leq 8 \cdot 10^{+73}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.09999999999999995e183 or 7.99999999999999986e73 < 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. associate--l+99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.09999999999999995e183 < z < 7.99999999999999986e73

    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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.9%

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

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

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

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

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

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

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

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

Alternative 5: 87.9% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.5e182 < z < 8.8000000000000005e120

    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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.9%

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

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

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

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

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

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

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

    if 8.8000000000000005e120 < z

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

Alternative 6: 85.1% accurate, 1.0× speedup?

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

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

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


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

    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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.49999999999999989e55 < 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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 99.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 8: 81.5% accurate, 1.0× speedup?

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

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

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


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

    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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.9%

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

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

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

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

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

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

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

    if 8.2e121 < z

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 81.5% accurate, 1.0× speedup?

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

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

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


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

    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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.9%

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

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

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

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

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

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

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

    if 7.79999999999999967e121 < z

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 81.5% accurate, 1.0× speedup?

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

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

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


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

    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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.9%

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

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

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

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

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

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

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

    if 1.35000000000000003e167 < 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. associate--l+99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 66.6% accurate, 6.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6 \cdot 10^{-146} \lor \neg \left(b \leq 1.75 \cdot 10^{-29}\right):\\
\;\;\;\;x + 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 < -6.00000000000000038e-146 or 1.7499999999999999e-29 < 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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.00000000000000038e-146 < b < 1.7499999999999999e-29

    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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 61.5% accurate, 7.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.35 \cdot 10^{+42} \lor \neg \left(b \leq 3.2 \cdot 10^{+111}\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.35e42 or 3.2000000000000001e111 < b

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35e42 < b < 3.2000000000000001e111

    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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    9. Simplified59.4%

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

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

Alternative 13: 51.8% accurate, 8.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.7 \cdot 10^{+85} \lor \neg \left(a \leq 1.4 \cdot 10^{+95}\right):\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.7000000000000002e85 or 1.3999999999999999e95 < a

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{b \cdot a} \]
    9. Simplified63.5%

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

    if -1.7000000000000002e85 < a < 1.3999999999999999e95

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    9. Simplified55.7%

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

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

Alternative 14: 28.4% accurate, 8.8× speedup?

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

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

\mathbf{elif}\;y \leq 6.5 \cdot 10^{+127}:\\
\;\;\;\;a \cdot b\\

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.2999999999999999e-280 < y < 6.5e127

    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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{b \cdot a} \]
    9. Simplified31.6%

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

    if 6.5e127 < 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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.3 \cdot 10^{-280}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+127}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 65.1% accurate, 9.6× speedup?

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

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

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


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

    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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.10000000000000007e100 < 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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.9%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(y + \color{blue}{b \cdot a}\right) \]
    9. Simplified91.0%

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

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

Alternative 16: 78.9% accurate, 10.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 78.9% accurate, 12.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 27.7% accurate, 19.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.55000000000000007e-5

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.55000000000000007e-5 < 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(\left(\left(y + x\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b} \]
      4. +-commutative99.9%

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

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

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

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

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

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

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

Alternative 19: 22.0% accurate, 115.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer Target 1: 99.4% accurate, 0.4× speedup?

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

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

Reproduce

?
herbie shell --seed 2024145 
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
  :precision binary64

  :alt
  (! :herbie-platform default (+ (+ (+ x y) (/ (* (- 1 (pow (log t) 2)) z) (+ 1 (log t)))) (* (- a 1/2) b)))

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