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

Percentage Accurate: 99.8% → 99.9%
Time: 13.1s
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.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 85.3% accurate, 1.0× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.19999999999999952e29 < 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. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 86.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -0.00145:\\ \;\;\;\;\mathsf{fma}\left(-0.5 + a, b, x + y\right)\\ \mathbf{elif}\;b \leq 2.6 \cdot 10^{-145}:\\ \;\;\;\;x + \left(y - z \cdot \left(-1 + \log t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y + \left(-0.5 \cdot b + b \cdot a\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -0.00145)
   (fma (+ -0.5 a) b (+ x y))
   (if (<= b 2.6e-145)
     (+ x (- y (* z (+ -1.0 (log t)))))
     (+ x (+ y (+ (* -0.5 b) (* b a)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -0.00145) {
		tmp = fma((-0.5 + a), b, (x + y));
	} else if (b <= 2.6e-145) {
		tmp = x + (y - (z * (-1.0 + log(t))));
	} else {
		tmp = x + (y + ((-0.5 * b) + (b * a)));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -0.00145)
		tmp = fma(Float64(-0.5 + a), b, Float64(x + y));
	elseif (b <= 2.6e-145)
		tmp = Float64(x + Float64(y - Float64(z * Float64(-1.0 + log(t)))));
	else
		tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(b * a))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -0.00145], N[(N[(-0.5 + a), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.6e-145], N[(x + N[(y - N[(z * N[(-1.0 + N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -0.00145:\\
\;\;\;\;\mathsf{fma}\left(-0.5 + a, b, x + y\right)\\

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(a + -0.5, b, x + y\right)} \]
      7. +-commutative93.0%

        \[\leadsto \mathsf{fma}\left(a + -0.5, b, \color{blue}{y + x}\right) \]
    7. Simplified93.0%

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

    if -0.00145 < b < 2.6e-145

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 85.2% accurate, 1.0× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - \left(z \cdot \log t - \left(a + -0.5\right) \cdot b\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 87.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+87.8%

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

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

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

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

    if 1.0499999999999999e77 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 84.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+230} \lor \neg \left(z \leq 5 \cdot 10^{+139}\right):\\
\;\;\;\;x - z \cdot \left(-1 + \log t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.0000000000000003e230 or 5.0000000000000003e139 < 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. fma-define99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000003e230 < z < 5.0000000000000003e139

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 84.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+229}:\\
\;\;\;\;x - z \cdot \left(-1 + \log t\right)\\

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

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


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

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.1999999999999998e229 < z < 5.0000000000000003e139

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000003e139 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 83.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{+234} \lor \neg \left(z \leq 5 \cdot 10^{+139}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.4000000000000003e234 or 5.0000000000000003e139 < 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. associate-+l+99.7%

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

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

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

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

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

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

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

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

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

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

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

    if -5.4000000000000003e234 < z < 5.0000000000000003e139

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 83.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8499999999999999e235 < z < 1.55e139

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.55e139 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - \left(z \cdot \log t - \left(a + -0.5\right) \cdot b\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutative99.9%

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

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

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

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

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

Alternative 10: 28.9% accurate, 5.0× speedup?

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

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

\mathbf{elif}\;y \leq 2.75 \cdot 10^{-137}:\\
\;\;\;\;b \cdot a\\

\mathbf{elif}\;y \leq 1.15 \cdot 10^{-17}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 7.5 \cdot 10^{+93}:\\
\;\;\;\;b \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.49999999999999958e-144 or 2.7500000000000001e-137 < y < 1.15000000000000004e-17

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.49999999999999958e-144 < y < 2.7500000000000001e-137 or 1.15000000000000004e-17 < y < 7.5000000000000002e93

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.5000000000000002e93 < y

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.5 \cdot 10^{-144}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.75 \cdot 10^{-137}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-17}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+93}:\\ \;\;\;\;b \cdot a\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 61.6% accurate, 7.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -24000000 \lor \neg \left(b \leq 5.4 \cdot 10^{-48}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.4e7 or 5.40000000000000023e-48 < 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. associate-+l+99.9%

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

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

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

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

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

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

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

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

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

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

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

    if -2.4e7 < b < 5.40000000000000023e-48

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    8. Simplified61.6%

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

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

Alternative 12: 49.9% accurate, 8.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -38000000 \lor \neg \left(b \leq 5.4 \cdot 10^{-48}\right):\\
\;\;\;\;b \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.8e7 or 5.40000000000000023e-48 < 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. associate-+l+99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.8e7 < b < 5.40000000000000023e-48

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    8. Simplified61.6%

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

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

Alternative 13: 61.8% accurate, 9.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.8 \cdot 10^{+119}:\\
\;\;\;\;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 y < 9.79999999999999992e119

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.79999999999999992e119 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    8. Simplified71.7%

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

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

Alternative 14: 62.9% accurate, 9.6× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.74999999999999988e100 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 64.7% accurate, 9.6× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 79.0% accurate, 10.5× speedup?

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

\\
x + \left(y + \left(-0.5 \cdot b + b \cdot a\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. associate-+l+99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 79.0% accurate, 12.8× speedup?

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

\\
x + \left(y + b \cdot \left(a - 0.5\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. associate-+l+99.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 28.4% accurate, 19.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.66 \cdot 10^{+18}:\\
\;\;\;\;x\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.66 \cdot 10^{+18}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. 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. 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. associate-+l+99.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification22.9%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 99.5% accurate, 0.4× speedup?

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

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

Reproduce

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

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

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