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

Percentage Accurate: 99.8% → 99.9%
Time: 10.9s
Alternatives: 17
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.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 -500 \lor \neg \left(t\_1 \leq 5\right):\\ \;\;\;\;\left(x + y\right) + t\_1\\ \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 -500.0) (not (<= t_1 5.0)))
     (+ (+ x y) t_1)
     (+ (* 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 <= -500.0) || !(t_1 <= 5.0)) {
		tmp = (x + y) + t_1;
	} 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 <= (-500.0d0)) .or. (.not. (t_1 <= 5.0d0))) then
        tmp = (x + y) + t_1
    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 <= -500.0) || !(t_1 <= 5.0)) {
		tmp = (x + y) + t_1;
	} 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 <= -500.0) or not (t_1 <= 5.0):
		tmp = (x + y) + t_1
	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 <= -500.0) || !(t_1 <= 5.0))
		tmp = Float64(Float64(x + y) + t_1);
	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 <= -500.0) || ~((t_1 <= 5.0)))
		tmp = (x + y) + t_1;
	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, -500.0], N[Not[LessEqual[t$95$1, 5.0]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] + t$95$1), $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 -500 \lor \neg \left(t\_1 \leq 5\right):\\
\;\;\;\;\left(x + y\right) + t\_1\\

\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) < -500 or 5 < (*.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 -inf 83.4%

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

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

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

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

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

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

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

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

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

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

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

    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.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 0 94.5%

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

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

Alternative 3: 78.8% accurate, 1.0× speedup?

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

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

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


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

    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 y around 0 72.1%

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

    if -9.9999999999999998e-67 < (+.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 82.6%

      \[\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. Add Preprocessing

Alternative 4: 83.4% 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^{+49}:\\ \;\;\;\;\left(x + \left(z + t\_1\right)\right) - z \cdot \log t\\ \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 (<= (+ x y) 5e+49) (- (+ x (+ z t_1)) (* z (log t))) (+ (+ 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 ((x + y) <= 5e+49) {
		tmp = (x + (z + t_1)) - (z * log(t));
	} else {
		tmp = (x + y) + t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = b * (a - 0.5d0)
    if ((x + y) <= 5d+49) then
        tmp = (x + (z + t_1)) - (z * log(t))
    else
        tmp = (x + y) + t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (a - 0.5);
	double tmp;
	if ((x + y) <= 5e+49) {
		tmp = (x + (z + t_1)) - (z * Math.log(t));
	} else {
		tmp = (x + y) + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (a - 0.5)
	tmp = 0
	if (x + y) <= 5e+49:
		tmp = (x + (z + t_1)) - (z * math.log(t))
	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 (Float64(x + y) <= 5e+49)
		tmp = Float64(Float64(x + Float64(z + t_1)) - Float64(z * log(t)));
	else
		tmp = Float64(Float64(x + 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 + y) <= 5e+49)
		tmp = (x + (z + t_1)) - (z * log(t));
	else
		tmp = (x + y) + t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], 5e+49], N[(N[(x + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $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}\;x + y \leq 5 \cdot 10^{+49}:\\
\;\;\;\;\left(x + \left(z + t\_1\right)\right) - z \cdot \log t\\

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


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

    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 y around 0 82.8%

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

    if 5.0000000000000004e49 < (+.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 z around -inf 69.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 86.4% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.79999999999999985e153 or 8.5000000000000001e92 < z

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.79999999999999985e153 < z < 8.5000000000000001e92

    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 -inf 74.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 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.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 7: 80.7% accurate, 1.0× speedup?

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

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

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


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

    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 -inf 77.3%

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

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

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

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

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

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

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

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

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

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

    if 2.0999999999999998e93 < 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 x around inf 71.3%

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

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

Alternative 8: 80.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 2.1 \cdot 10^{+168}:\\ \;\;\;\;\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 2.1e+168) (+ (+ 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 <= 2.1e+168) {
		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 <= 2.1d+168) 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 <= 2.1e+168) {
		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 <= 2.1e+168:
		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 <= 2.1e+168)
		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 <= 2.1e+168)
		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, 2.1e+168], 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 2.1 \cdot 10^{+168}:\\
\;\;\;\;\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 < 2.10000000000000003e168

    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 -inf 78.6%

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

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

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

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

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

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

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

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

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

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

    if 2.10000000000000003e168 < 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 x around inf 77.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 2.1 \cdot 10^{+168}:\\ \;\;\;\;\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 9: 71.1% 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^{+64} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+149}\right):\\ \;\;\;\;y + t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) + -0.5 \cdot b\\ \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+64) (not (<= t_1 2e+149)))
     (+ y t_1)
     (+ (+ x y) (* -0.5 b)))))
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+64) || !(t_1 <= 2e+149)) {
		tmp = y + t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = b * (a - 0.5d0)
    if ((t_1 <= (-2d+64)) .or. (.not. (t_1 <= 2d+149))) then
        tmp = y + t_1
    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 t_1 = b * (a - 0.5);
	double tmp;
	if ((t_1 <= -2e+64) || !(t_1 <= 2e+149)) {
		tmp = y + t_1;
	} else {
		tmp = (x + y) + (-0.5 * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (a - 0.5)
	tmp = 0
	if (t_1 <= -2e+64) or not (t_1 <= 2e+149):
		tmp = y + t_1
	else:
		tmp = (x + y) + (-0.5 * b)
	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+64) || !(t_1 <= 2e+149))
		tmp = Float64(y + t_1);
	else
		tmp = Float64(Float64(x + y) + Float64(-0.5 * b));
	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+64) || ~((t_1 <= 2e+149)))
		tmp = y + t_1;
	else
		tmp = (x + y) + (-0.5 * b);
	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+64], N[Not[LessEqual[t$95$1, 2e+149]], $MachinePrecision]], N[(y + t$95$1), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -2.00000000000000004e64 or 2.0000000000000001e149 < (*.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 -inf 83.3%

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

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

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

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

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

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

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

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

    if -2.00000000000000004e64 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2.0000000000000001e149

    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 z around -inf 80.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 77.5% accurate, 5.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a - 0.5 \leq -50000 \lor \neg \left(a - 0.5 \leq -0.4\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) -50000.0) (not (<= (- a 0.5) -0.4)))
   (+ (+ 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) <= -50000.0) || !((a - 0.5) <= -0.4)) {
		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) <= (-50000.0d0)) .or. (.not. ((a - 0.5d0) <= (-0.4d0)))) 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) <= -50000.0) || !((a - 0.5) <= -0.4)) {
		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) <= -50000.0) or not ((a - 0.5) <= -0.4):
		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) <= -50000.0) || !(Float64(a - 0.5) <= -0.4))
		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) <= -50000.0) || ~(((a - 0.5) <= -0.4)))
		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], -50000.0], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4]], $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 -50000 \lor \neg \left(a - 0.5 \leq -0.4\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)) < -5e4 or -0.40000000000000002 < (-.f64 a #s(literal 1/2 binary64))

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    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 z around -inf 80.5%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a - 0.5 \leq -50000 \lor \neg \left(a - 0.5 \leq -0.4\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: 37.0% accurate, 6.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -24000000000:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;a \leq -1.4 \cdot 10^{-37}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 0.5:\\
\;\;\;\;-0.5 \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.4e10 or 0.5 < a

    1. Initial program 99.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \left(x \cdot \left(\frac{a}{x} - 0.5 \cdot \frac{1}{x}\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*47.4%

        \[\leadsto \color{blue}{\left(b \cdot x\right) \cdot \left(\frac{a}{x} - 0.5 \cdot \frac{1}{x}\right)} \]
      2. *-commutative47.4%

        \[\leadsto \color{blue}{\left(x \cdot b\right)} \cdot \left(\frac{a}{x} - 0.5 \cdot \frac{1}{x}\right) \]
      3. associate-*r/47.4%

        \[\leadsto \left(x \cdot b\right) \cdot \left(\frac{a}{x} - \color{blue}{\frac{0.5 \cdot 1}{x}}\right) \]
      4. metadata-eval47.4%

        \[\leadsto \left(x \cdot b\right) \cdot \left(\frac{a}{x} - \frac{\color{blue}{0.5}}{x}\right) \]
      5. div-sub47.4%

        \[\leadsto \left(x \cdot b\right) \cdot \color{blue}{\frac{a - 0.5}{x}} \]
      6. sub-neg47.4%

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

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

        \[\leadsto \left(x \cdot b\right) \cdot \frac{\color{blue}{-0.5 + a}}{x} \]
    10. Simplified47.4%

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

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

        \[\leadsto \color{blue}{b \cdot a} \]
    13. Simplified54.1%

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

    if -2.4e10 < a < -1.4000000000000001e-37

    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--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 x around inf 59.0%

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

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

    if -1.4000000000000001e-37 < a < 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. 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. Taylor expanded in x around inf 76.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \left(x \cdot \left(\frac{a}{x} - 0.5 \cdot \frac{1}{x}\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*19.1%

        \[\leadsto \color{blue}{\left(b \cdot x\right) \cdot \left(\frac{a}{x} - 0.5 \cdot \frac{1}{x}\right)} \]
      2. *-commutative19.1%

        \[\leadsto \color{blue}{\left(x \cdot b\right)} \cdot \left(\frac{a}{x} - 0.5 \cdot \frac{1}{x}\right) \]
      3. associate-*r/19.1%

        \[\leadsto \left(x \cdot b\right) \cdot \left(\frac{a}{x} - \color{blue}{\frac{0.5 \cdot 1}{x}}\right) \]
      4. metadata-eval19.1%

        \[\leadsto \left(x \cdot b\right) \cdot \left(\frac{a}{x} - \frac{\color{blue}{0.5}}{x}\right) \]
      5. div-sub19.1%

        \[\leadsto \left(x \cdot b\right) \cdot \color{blue}{\frac{a - 0.5}{x}} \]
      6. sub-neg19.1%

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

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

        \[\leadsto \left(x \cdot b\right) \cdot \frac{\color{blue}{-0.5 + a}}{x} \]
    10. Simplified19.1%

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

      \[\leadsto \color{blue}{-0.5 \cdot b} \]
    12. Step-by-step derivation
      1. *-commutative27.2%

        \[\leadsto \color{blue}{b \cdot -0.5} \]
    13. Simplified27.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -24000000000:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \leq -1.4 \cdot 10^{-37}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 0.5:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 56.4% accurate, 6.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + \frac{y}{x}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -0.089999999999999997 or 1.32000000000000007e-5 < b

    1. Initial program 100.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \left(x \cdot \left(\frac{a}{x} - 0.5 \cdot \frac{1}{x}\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*58.3%

        \[\leadsto \color{blue}{\left(b \cdot x\right) \cdot \left(\frac{a}{x} - 0.5 \cdot \frac{1}{x}\right)} \]
      2. *-commutative58.3%

        \[\leadsto \color{blue}{\left(x \cdot b\right)} \cdot \left(\frac{a}{x} - 0.5 \cdot \frac{1}{x}\right) \]
      3. associate-*r/58.3%

        \[\leadsto \left(x \cdot b\right) \cdot \left(\frac{a}{x} - \color{blue}{\frac{0.5 \cdot 1}{x}}\right) \]
      4. metadata-eval58.3%

        \[\leadsto \left(x \cdot b\right) \cdot \left(\frac{a}{x} - \frac{\color{blue}{0.5}}{x}\right) \]
      5. div-sub58.3%

        \[\leadsto \left(x \cdot b\right) \cdot \color{blue}{\frac{a - 0.5}{x}} \]
      6. sub-neg58.3%

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

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

        \[\leadsto \left(x \cdot b\right) \cdot \frac{\color{blue}{-0.5 + a}}{x} \]
    10. Simplified58.3%

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

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

    if -0.089999999999999997 < b < 1.32000000000000007e-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. 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. Taylor expanded in x around inf 79.4%

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

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

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

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

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

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

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

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

Alternative 13: 61.8% accurate, 9.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{+144}:\\
\;\;\;\;x \cdot \left(1 + \frac{y}{x}\right)\\

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


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

    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 99.9%

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

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

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

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

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

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

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

    if -5.50000000000000022e144 < 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 z around -inf 84.4%

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

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

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

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

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

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

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

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

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

Alternative 14: 41.5% accurate, 11.5× speedup?

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

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

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


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

    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 57.5%

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

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

    if -5.9999999999999998e144 < 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 x around inf 76.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \left(x \cdot \left(\frac{a}{x} - 0.5 \cdot \frac{1}{x}\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*34.7%

        \[\leadsto \color{blue}{\left(b \cdot x\right) \cdot \left(\frac{a}{x} - 0.5 \cdot \frac{1}{x}\right)} \]
      2. *-commutative34.7%

        \[\leadsto \color{blue}{\left(x \cdot b\right)} \cdot \left(\frac{a}{x} - 0.5 \cdot \frac{1}{x}\right) \]
      3. associate-*r/34.7%

        \[\leadsto \left(x \cdot b\right) \cdot \left(\frac{a}{x} - \color{blue}{\frac{0.5 \cdot 1}{x}}\right) \]
      4. metadata-eval34.7%

        \[\leadsto \left(x \cdot b\right) \cdot \left(\frac{a}{x} - \frac{\color{blue}{0.5}}{x}\right) \]
      5. div-sub34.7%

        \[\leadsto \left(x \cdot b\right) \cdot \color{blue}{\frac{a - 0.5}{x}} \]
      6. sub-neg34.7%

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \left(a - 0.5\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 78.0% 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 -inf 81.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 20.6% accurate, 14.3× speedup?

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

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

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


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

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

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

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

    if -4.7999999999999997e51 < 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 x around inf 73.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \left(x \cdot \left(\frac{a}{x} - 0.5 \cdot \frac{1}{x}\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*34.1%

        \[\leadsto \color{blue}{\left(b \cdot x\right) \cdot \left(\frac{a}{x} - 0.5 \cdot \frac{1}{x}\right)} \]
      2. *-commutative34.1%

        \[\leadsto \color{blue}{\left(x \cdot b\right)} \cdot \left(\frac{a}{x} - 0.5 \cdot \frac{1}{x}\right) \]
      3. associate-*r/34.1%

        \[\leadsto \left(x \cdot b\right) \cdot \left(\frac{a}{x} - \color{blue}{\frac{0.5 \cdot 1}{x}}\right) \]
      4. metadata-eval34.1%

        \[\leadsto \left(x \cdot b\right) \cdot \left(\frac{a}{x} - \frac{\color{blue}{0.5}}{x}\right) \]
      5. div-sub34.1%

        \[\leadsto \left(x \cdot b\right) \cdot \color{blue}{\frac{a - 0.5}{x}} \]
      6. sub-neg34.1%

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

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

        \[\leadsto \left(x \cdot b\right) \cdot \frac{\color{blue}{-0.5 + a}}{x} \]
    10. Simplified34.1%

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

      \[\leadsto \color{blue}{-0.5 \cdot b} \]
    12. Step-by-step derivation
      1. *-commutative15.2%

        \[\leadsto \color{blue}{b \cdot -0.5} \]
    13. Simplified15.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{+51}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 22.3% accurate, 115.0× speedup?

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

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

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

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

Developer Target 1: 99.6% 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 2024167 
(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)))