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

Percentage Accurate: 99.8% → 99.9%
Time: 11.7s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 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.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.9%

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

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

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

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

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

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

Alternative 2: 90.0% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 100.0%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube99.9%

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

        \[\leadsto \left(\left(\left(x + y\right) + z\right) - z \cdot \sqrt[3]{\color{blue}{{\log t}^{3}}}\right) + \left(a - 0.5\right) \cdot b \]
    4. Applied egg-rr100.0%

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

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

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

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

    if -1e20 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1e71

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 83.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 100.0%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube100.0%

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

        \[\leadsto \left(\left(\left(x + y\right) + z\right) - z \cdot \sqrt[3]{\color{blue}{{\log t}^{3}}}\right) + \left(a - 0.5\right) \cdot b \]
    4. Applied egg-rr100.0%

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

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

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

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

    if -4.99999999999999973e33 < (+.f64 x y)

    1. Initial program 99.8%

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

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

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

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

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

Alternative 4: 85.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+151}:\\
\;\;\;\;t\_1 + y\\

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

\mathbf{else}:\\
\;\;\;\;t\_1 + a \cdot b\\


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

    1. Initial program 99.3%

      \[\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.3%

        \[\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.3%

        \[\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.3%

        \[\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.3%

        \[\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.3%

        \[\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.3%

        \[\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.3%

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

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

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

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

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

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

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

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

    if -1.45000000000000009e151 < z < 1.44999999999999994e97

    1. Initial program 100.0%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube99.9%

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

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

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

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

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

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

    if 1.44999999999999994e97 < z

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 85.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{+175} \lor \neg \left(z \leq 1.5 \cdot 10^{+97}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.22e175 or 1.4999999999999999e97 < z

    1. Initial program 99.5%

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

        \[\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.5%

        \[\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.5%

        \[\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.5%

        \[\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.5%

        \[\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.5%

        \[\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.5%

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

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

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

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

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

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

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

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

    if -1.22e175 < z < 1.4999999999999999e97

    1. Initial program 100.0%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube99.9%

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

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

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

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

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

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

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

Alternative 6: 84.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+149}:\\
\;\;\;\;t\_1 + y\\

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

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


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

    1. Initial program 99.3%

      \[\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.3%

        \[\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.3%

        \[\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.3%

        \[\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.3%

        \[\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.3%

        \[\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.3%

        \[\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.3%

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

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

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

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

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

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

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

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

    if -2.9000000000000002e149 < z < 1.4999999999999999e97

    1. Initial program 100.0%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube99.9%

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

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

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

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

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

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

    if 1.4999999999999999e97 < z

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 83.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+177} \lor \neg \left(z \leq 5.6 \cdot 10^{+158}\right):\\
\;\;\;\;z - z \cdot \log t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.74999999999999996e177 or 5.60000000000000003e158 < z

    1. Initial program 99.4%

      \[\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 inf 81.5%

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

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

    if -1.74999999999999996e177 < z < 5.60000000000000003e158

    1. Initial program 100.0%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube99.9%

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

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

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

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

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

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

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

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

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

    \[\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 9: 67.0% accurate, 4.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1.99999999999999998e204 or 3.9999999999999999e82 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)

    1. Initial program 100.0%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube100.0%

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

        \[\leadsto \left(\left(\left(x + y\right) + z\right) - z \cdot \sqrt[3]{\color{blue}{{\log t}^{3}}}\right) + \left(a - 0.5\right) \cdot b \]
    4. Applied egg-rr100.0%

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

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

    if -1.99999999999999998e204 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 3.9999999999999999e82

    1. Initial program 99.7%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube99.7%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    11. Simplified59.2%

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

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

Alternative 10: 77.3% accurate, 5.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -50 \lor \neg \left(a - 0.5 \leq -0.5\right):\\
\;\;\;\;\left(x + y\right) + a \cdot b\\

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


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

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube99.9%

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

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

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

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

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

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

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

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

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube99.7%

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

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

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

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

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

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

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

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

Alternative 11: 60.5% accurate, 7.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-11} \lor \neg \left(b \leq 7.4 \cdot 10^{+58}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.99999999999999976e-11 or 7.4000000000000004e58 < 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. Step-by-step derivation
      1. add-cbrt-cube99.9%

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

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

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

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

    if -3.99999999999999976e-11 < b < 7.4000000000000004e58

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube99.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + y} \]
    10. Step-by-step derivation
      1. +-commutative58.5%

        \[\leadsto \color{blue}{y + x} \]
    11. Simplified58.5%

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

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

Alternative 12: 51.4% accurate, 8.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{+118} \lor \neg \left(a \leq 3.8 \cdot 10^{+150}\right):\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.30000000000000016e118 or 3.79999999999999989e150 < a

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube99.9%

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

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

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

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

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

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

    if -2.30000000000000016e118 < a < 3.79999999999999989e150

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube99.7%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    11. Simplified49.5%

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

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

Alternative 13: 36.0% accurate, 8.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -0.5 or 1.3999999999999999e-43 < a

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube99.9%

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

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

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

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

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

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

    if -0.5 < a < 1.3999999999999999e-43

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube99.7%

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

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

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

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

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

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

Alternative 14: 62.2% accurate, 9.6× speedup?

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

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

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


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

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube99.8%

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

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

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

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

    if 3.8000000000000001e-44 < y

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube99.8%

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

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

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

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

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

Alternative 15: 78.0% accurate, 12.8× speedup?

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

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

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-cbrt-cube99.8%

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

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

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

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

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

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

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

Alternative 16: 13.7% accurate, 38.3× speedup?

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

\\
-0.5 \cdot b
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-cbrt-cube99.8%

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

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

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

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

    \[\leadsto b \cdot \color{blue}{-0.5} \]
  7. Final simplification15.3%

    \[\leadsto -0.5 \cdot b \]
  8. Add Preprocessing

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

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

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