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

Percentage Accurate: 99.8% → 99.9%
Time: 12.6s
Alternatives: 18
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 18 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.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+144} \lor \neg \left(t\_1 \leq 6 \cdot 10^{+116}\right):\\ \;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(1 - \log t\right) + \left(x + y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (- a 0.5))))
   (if (or (<= t_1 -4e+144) (not (<= t_1 6e+116)))
     (+ x (+ y (* (+ a -0.5) b)))
     (+ (* 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 <= -4e+144) || !(t_1 <= 6e+116)) {
		tmp = x + (y + ((a + -0.5) * b));
	} 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 <= (-4d+144)) .or. (.not. (t_1 <= 6d+116))) then
        tmp = x + (y + ((a + (-0.5d0)) * b))
    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 <= -4e+144) || !(t_1 <= 6e+116)) {
		tmp = x + (y + ((a + -0.5) * b));
	} 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 <= -4e+144) or not (t_1 <= 6e+116):
		tmp = x + (y + ((a + -0.5) * b))
	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 <= -4e+144) || !(t_1 <= 6e+116))
		tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b)));
	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 <= -4e+144) || ~((t_1 <= 6e+116)))
		tmp = x + (y + ((a + -0.5) * b));
	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, -4e+144], N[Not[LessEqual[t$95$1, 6e+116]], $MachinePrecision]], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -4.00000000000000009e144 or 5.9999999999999997e116 < (*.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 a around 0 99.9%

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

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

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

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

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

    if -4.00000000000000009e144 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 5.9999999999999997e116

    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 b around 0 91.9%

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

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

Alternative 3: 79.1% accurate, 1.0× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

    if -5.0000000000000002e-27 < (+.f64 x y)

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

Alternative 4: 84.1% accurate, 1.0× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

    if 5e102 < (+.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 a around 0 99.9%

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

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

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

Alternative 5: 86.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+225} \lor \neg \left(z \leq 6 \cdot 10^{+166}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.1e225 or 5.99999999999999997e166 < z

    1. Initial program 99.5%

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

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

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.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 86.8%

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

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

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

    if -2.1e225 < z < 5.99999999999999997e166

    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 a around 0 99.9%

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

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

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

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

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

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

Alternative 6: 84.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+241} \lor \neg \left(z \leq 3.7 \cdot 10^{+209}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.34999999999999986e241 or 3.7e209 < z

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.34999999999999986e241 < z < 3.7e209

    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 a around 0 99.9%

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

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

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

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

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

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

Alternative 7: 84.2% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

    if -6.80000000000000017e240 < z < 3.60000000000000014e207

    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 a around 0 99.9%

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

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

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

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

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

    if 3.60000000000000014e207 < z

    1. Initial program 99.3%

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

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

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

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

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

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

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

        \[\leadsto \left(\left(--1\right) \cdot z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + \left(x + y\right)\right) \]
      8. distribute-rgt-out--99.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 70.3%

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

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

Alternative 8: 83.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+240} \lor \neg \left(z \leq 3.3 \cdot 10^{+219}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.80000000000000017e240 or 3.3000000000000002e219 < z

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.80000000000000017e240 < z < 3.3000000000000002e219

    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 a around 0 99.9%

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

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

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

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

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

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

Alternative 9: 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 10: 47.2% accurate, 6.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -5 \cdot 10^{+29}:\\
\;\;\;\;x + a \cdot b\\

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000001e29 < (+.f64 x y) < 1.9999999999999998e165

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto b \cdot \left(y \cdot \left(\frac{a}{y} - \frac{\color{blue}{0.5}}{y}\right)\right) \]
      3. div-sub47.9%

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

        \[\leadsto b \cdot \left(y \cdot \frac{\color{blue}{a + \left(-0.5\right)}}{y}\right) \]
      5. metadata-eval47.9%

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

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

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

    if 1.9999999999999998e165 < (+.f64 x y)

    1. Initial program 100.0%

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

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

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

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

Alternative 11: 66.7% accurate, 6.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.1 \cdot 10^{-99} \lor \neg \left(b \leq 5.5 \cdot 10^{-56}\right):\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.10000000000000002e-99 or 5.4999999999999999e-56 < 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 y around 0 83.5%

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

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

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

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

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

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

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

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

    if -1.10000000000000002e-99 < b < 5.4999999999999999e-56

    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 b around 0 93.8%

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

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

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

Alternative 12: 61.0% accurate, 7.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.36 \cdot 10^{+92} \lor \neg \left(b \leq 1.1 \cdot 10^{-15}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.36e92 or 1.09999999999999993e-15 < b

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto b \cdot \left(y \cdot \left(\frac{a}{y} - \color{blue}{\frac{0.5 \cdot 1}{y}}\right)\right) \]
      2. metadata-eval65.7%

        \[\leadsto b \cdot \left(y \cdot \left(\frac{a}{y} - \frac{\color{blue}{0.5}}{y}\right)\right) \]
      3. div-sub65.7%

        \[\leadsto b \cdot \left(y \cdot \color{blue}{\frac{a - 0.5}{y}}\right) \]
      4. sub-neg65.7%

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

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

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

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

    if -1.36e92 < b < 1.09999999999999993e-15

    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 b around 0 85.8%

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

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

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

Alternative 13: 58.4% accurate, 8.2× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

    if -9.999999999999999e-94 < (+.f64 x y)

    1. Initial program 99.8%

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

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

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

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

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

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

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

Alternative 14: 52.4% accurate, 8.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{+94} \lor \neg \left(a \leq 3.6 \cdot 10^{+93}\right):\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.7000000000000001e94 or 3.5999999999999999e93 < 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 y around inf 75.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto b \cdot \left(y \cdot \left(\frac{a}{y} - \color{blue}{\frac{0.5 \cdot 1}{y}}\right)\right) \]
      2. metadata-eval56.6%

        \[\leadsto b \cdot \left(y \cdot \left(\frac{a}{y} - \frac{\color{blue}{0.5}}{y}\right)\right) \]
      3. div-sub56.6%

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

        \[\leadsto b \cdot \left(y \cdot \frac{\color{blue}{a + \left(-0.5\right)}}{y}\right) \]
      5. metadata-eval56.6%

        \[\leadsto b \cdot \left(y \cdot \frac{a + \color{blue}{-0.5}}{y}\right) \]
    10. Simplified56.6%

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

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

    if -2.7000000000000001e94 < a < 3.5999999999999999e93

    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 b around 0 78.1%

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

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

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

Alternative 15: 28.7% accurate, 8.8× speedup?

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

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

\mathbf{elif}\;x \leq 4 \cdot 10^{-295}:\\
\;\;\;\;a \cdot b\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.9999999999999993e181 < x < 4.00000000000000024e-295

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto b \cdot \left(y \cdot \left(\frac{a}{y} - \color{blue}{\frac{0.5 \cdot 1}{y}}\right)\right) \]
      2. metadata-eval43.6%

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

        \[\leadsto b \cdot \left(y \cdot \color{blue}{\frac{a - 0.5}{y}}\right) \]
      4. sub-neg43.5%

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

        \[\leadsto b \cdot \left(y \cdot \frac{a + \color{blue}{-0.5}}{y}\right) \]
    10. Simplified43.5%

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

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

    if 4.00000000000000024e-295 < x

    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 a around 0 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{+181}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-295}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 78.8% accurate, 12.8× speedup?

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

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

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

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

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

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

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

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

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

Alternative 17: 29.1% accurate, 19.1× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7500000000000001e54 < x

    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 a around 0 99.8%

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

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

Alternative 18: 22.1% 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 38.6%

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

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

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

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

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

Reproduce

?
herbie shell --seed 2024157 
(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)))