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

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

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;t\_1 \leq -2000000000:\\ \;\;\;\;\mathsf{fma}\left(b, a + -0.5, x + y\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-9}:\\ \;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) + t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (- a 0.5))))
   (if (<= t_1 -2000000000.0)
     (fma b (+ a -0.5) (+ x y))
     (if (<= t_1 5e-9) (+ x (+ (* z (- 1.0 (log t))) y)) (+ (+ x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (a - 0.5);
	double tmp;
	if (t_1 <= -2000000000.0) {
		tmp = fma(b, (a + -0.5), (x + y));
	} else if (t_1 <= 5e-9) {
		tmp = x + ((z * (1.0 - log(t))) + y);
	} else {
		tmp = (x + 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 (t_1 <= -2000000000.0)
		tmp = fma(b, Float64(a + -0.5), Float64(x + y));
	elseif (t_1 <= 5e-9)
		tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + y));
	else
		tmp = Float64(Float64(x + y) + t_1);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2000000000.0], N[(b * N[(a + -0.5), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-9], N[(x + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -2000000000:\\
\;\;\;\;\mathsf{fma}\left(b, a + -0.5, x + y\right)\\

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e9 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 5.0000000000000001e-9

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000001e-9 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)

    1. Initial program 99.9%

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

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

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

Alternative 3: 82.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e15 < (+.f64 x y)

    1. Initial program 99.9%

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

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

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

Alternative 4: 99.9% accurate, 1.0× speedup?

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

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

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Add Preprocessing
  3. Final simplification99.9%

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

Alternative 5: 81.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.65 \cdot 10^{+183}:\\
\;\;\;\;\mathsf{fma}\left(b, a + -0.5, x + y\right)\\

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.65000000000000005e183 < z

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \left(z \cdot \left(\frac{1}{b} - \frac{\log t}{b}\right)\right)} \]
    9. Step-by-step derivation
      1. *-commutative40.7%

        \[\leadsto \color{blue}{\left(z \cdot \left(\frac{1}{b} - \frac{\log t}{b}\right)\right) \cdot b} \]
      2. div-sub40.7%

        \[\leadsto \left(z \cdot \color{blue}{\frac{1 - \log t}{b}}\right) \cdot b \]
      3. associate-*r*66.0%

        \[\leadsto \color{blue}{z \cdot \left(\frac{1 - \log t}{b} \cdot b\right)} \]
      4. associate-*l/65.8%

        \[\leadsto z \cdot \color{blue}{\frac{\left(1 - \log t\right) \cdot b}{b}} \]
    10. Simplified65.8%

      \[\leadsto \color{blue}{z \cdot \frac{\left(1 - \log t\right) \cdot b}{b}} \]
    11. Taylor expanded in z around 0 66.0%

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right)} \]
    12. Step-by-step derivation
      1. *-commutative66.0%

        \[\leadsto \color{blue}{\left(1 - \log t\right) \cdot z} \]
    13. Simplified66.0%

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

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

Alternative 6: 81.5% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

    if 1.5499999999999999e183 < z

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \left(z \cdot \left(\frac{1}{b} - \frac{\log t}{b}\right)\right)} \]
    9. Step-by-step derivation
      1. *-commutative40.7%

        \[\leadsto \color{blue}{\left(z \cdot \left(\frac{1}{b} - \frac{\log t}{b}\right)\right) \cdot b} \]
      2. div-sub40.7%

        \[\leadsto \left(z \cdot \color{blue}{\frac{1 - \log t}{b}}\right) \cdot b \]
      3. associate-*r*66.0%

        \[\leadsto \color{blue}{z \cdot \left(\frac{1 - \log t}{b} \cdot b\right)} \]
      4. associate-*l/65.8%

        \[\leadsto z \cdot \color{blue}{\frac{\left(1 - \log t\right) \cdot b}{b}} \]
    10. Simplified65.8%

      \[\leadsto \color{blue}{z \cdot \frac{\left(1 - \log t\right) \cdot b}{b}} \]
    11. Taylor expanded in z around 0 66.0%

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right)} \]
    12. Step-by-step derivation
      1. *-commutative66.0%

        \[\leadsto \color{blue}{\left(1 - \log t\right) \cdot z} \]
    13. Simplified66.0%

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

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

Alternative 7: 36.1% accurate, 4.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{+92}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-273} \lor \neg \left(x \leq 9.4 \cdot 10^{-173}\right) \land x \leq 2.2 \cdot 10^{+34}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -5.5e+92)
   x
   (if (or (<= x -4.8e-273) (and (not (<= x 9.4e-173)) (<= x 2.2e+34)))
     (* b (- a 0.5))
     y)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -5.5e+92) {
		tmp = x;
	} else if ((x <= -4.8e-273) || (!(x <= 9.4e-173) && (x <= 2.2e+34))) {
		tmp = b * (a - 0.5);
	} else {
		tmp = y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (x <= (-5.5d+92)) then
        tmp = x
    else if ((x <= (-4.8d-273)) .or. (.not. (x <= 9.4d-173)) .and. (x <= 2.2d+34)) then
        tmp = b * (a - 0.5d0)
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -5.5e+92) {
		tmp = x;
	} else if ((x <= -4.8e-273) || (!(x <= 9.4e-173) && (x <= 2.2e+34))) {
		tmp = b * (a - 0.5);
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -5.5e+92:
		tmp = x
	elif (x <= -4.8e-273) or (not (x <= 9.4e-173) and (x <= 2.2e+34)):
		tmp = b * (a - 0.5)
	else:
		tmp = y
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -5.5e+92)
		tmp = x;
	elseif ((x <= -4.8e-273) || (!(x <= 9.4e-173) && (x <= 2.2e+34)))
		tmp = Float64(b * Float64(a - 0.5));
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= -5.5e+92)
		tmp = x;
	elseif ((x <= -4.8e-273) || (~((x <= 9.4e-173)) && (x <= 2.2e+34)))
		tmp = b * (a - 0.5);
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -5.5e+92], x, If[Or[LessEqual[x, -4.8e-273], And[N[Not[LessEqual[x, 9.4e-173]], $MachinePrecision], LessEqual[x, 2.2e+34]]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], y]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -4.8 \cdot 10^{-273} \lor \neg \left(x \leq 9.4 \cdot 10^{-173}\right) \land x \leq 2.2 \cdot 10^{+34}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.50000000000000053e92

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.50000000000000053e92 < x < -4.79999999999999963e-273 or 9.4000000000000001e-173 < x < 2.2000000000000002e34

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.79999999999999963e-273 < x < 9.4000000000000001e-173 or 2.2000000000000002e34 < x

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{+92}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-273} \lor \neg \left(x \leq 9.4 \cdot 10^{-173}\right) \land x \leq 2.2 \cdot 10^{+34}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 37.1% accurate, 4.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+22}:\\
\;\;\;\;x + -0.5 \cdot b\\

\mathbf{elif}\;x \leq -8 \cdot 10^{-275} \lor \neg \left(x \leq 6 \cdot 10^{-170}\right) \land x \leq 1.05 \cdot 10^{+36}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.1999999999999996e22

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + -0.5 \cdot b} \]
    8. Step-by-step derivation
      1. *-commutative52.1%

        \[\leadsto x + \color{blue}{b \cdot -0.5} \]
    9. Simplified52.1%

      \[\leadsto \color{blue}{x + b \cdot -0.5} \]

    if -4.1999999999999996e22 < x < -7.99999999999999947e-275 or 6.00000000000000027e-170 < x < 1.05000000000000002e36

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.99999999999999947e-275 < x < 6.00000000000000027e-170 or 1.05000000000000002e36 < x

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{+22}:\\ \;\;\;\;x + -0.5 \cdot b\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-275} \lor \neg \left(x \leq 6 \cdot 10^{-170}\right) \land x \leq 1.05 \cdot 10^{+36}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 61.9% accurate, 5.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.1 \cdot 10^{+47} \lor \neg \left(y \leq 1.45 \cdot 10^{+86}\right) \land y \leq 2.9 \cdot 10^{+190}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.1e47 or 1.44999999999999995e86 < y < 2.89999999999999989e190

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1e47 < y < 1.44999999999999995e86 or 2.89999999999999989e190 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y + \color{blue}{-0.5 \cdot b} \]
    8. Step-by-step derivation
      1. *-commutative75.2%

        \[\leadsto y + \color{blue}{b \cdot -0.5} \]
    9. Simplified75.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.1 \cdot 10^{+47} \lor \neg \left(y \leq 1.45 \cdot 10^{+86}\right) \land y \leq 2.9 \cdot 10^{+190}:\\ \;\;\;\;x + b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y + -0.5 \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 40.5% accurate, 7.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+22}:\\
\;\;\;\;x + -0.5 \cdot b\\

\mathbf{elif}\;x \leq -2.15 \cdot 10^{-265}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.8e22

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + -0.5 \cdot b} \]
    8. Step-by-step derivation
      1. *-commutative52.1%

        \[\leadsto x + \color{blue}{b \cdot -0.5} \]
    9. Simplified52.1%

      \[\leadsto \color{blue}{x + b \cdot -0.5} \]

    if -2.8e22 < x < -2.1500000000000001e-265

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1500000000000001e-265 < x

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y + \color{blue}{-0.5 \cdot b} \]
    8. Step-by-step derivation
      1. *-commutative39.9%

        \[\leadsto y + \color{blue}{b \cdot -0.5} \]
    9. Simplified39.9%

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

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

Alternative 11: 28.2% accurate, 8.8× speedup?

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

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

\mathbf{elif}\;x \leq -2.1 \cdot 10^{-270}:\\
\;\;\;\;a \cdot b\\

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.02e14 < x < -2.09999999999999996e-270

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.09999999999999996e-270 < x

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 64.4% accurate, 9.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;x \leq -2.7 \cdot 10^{+15}:\\ \;\;\;\;x + t\_1\\ \mathbf{else}:\\ \;\;\;\;y + t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (- a 0.5)))) (if (<= x -2.7e+15) (+ x t_1) (+ y t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (a - 0.5);
	double tmp;
	if (x <= -2.7e+15) {
		tmp = x + t_1;
	} else {
		tmp = y + t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = b * (a - 0.5d0)
    if (x <= (-2.7d+15)) then
        tmp = x + t_1
    else
        tmp = y + t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (a - 0.5);
	double tmp;
	if (x <= -2.7e+15) {
		tmp = x + t_1;
	} else {
		tmp = y + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (a - 0.5)
	tmp = 0
	if x <= -2.7e+15:
		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 (x <= -2.7e+15)
		tmp = Float64(x + t_1);
	else
		tmp = Float64(y + t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = b * (a - 0.5);
	tmp = 0.0;
	if (x <= -2.7e+15)
		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[x, -2.7e+15], N[(x + t$95$1), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]
\begin{array}{l}

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.7e15 < x

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 79.1% accurate, 12.8× speedup?

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

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

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

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

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

Alternative 14: 27.5% accurate, 19.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4800000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z t a b) :precision binary64 (if (<= x -4800000.0) x y))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -4800000.0) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (x <= (-4800000.0d0)) then
        tmp = x
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -4800000.0) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -4800000.0:
		tmp = x
	else:
		tmp = y
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -4800000.0)
		tmp = x;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= -4800000.0)
		tmp = x;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4800000.0], x, y]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4800000:\\
\;\;\;\;x\\

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.8e6 < x

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4800000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 22.3% accurate, 115.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification25.8%

    \[\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 2024066 
(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)))