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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 2: 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 3: 66.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;x + y \leq -200000:\\ \;\;\;\;x + t\_1\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{+40}:\\ \;\;\;\;z \cdot \left(1 - \log t\right) + 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) -200000.0)
     (+ x t_1)
     (if (<= (+ x y) 2e+40) (+ (* z (- 1.0 (log t))) 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) <= -200000.0) {
		tmp = x + t_1;
	} else if ((x + y) <= 2e+40) {
		tmp = (z * (1.0 - log(t))) + 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) <= (-200000.0d0)) then
        tmp = x + t_1
    else if ((x + y) <= 2d+40) then
        tmp = (z * (1.0d0 - log(t))) + 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) <= -200000.0) {
		tmp = x + t_1;
	} else if ((x + y) <= 2e+40) {
		tmp = (z * (1.0 - Math.log(t))) + 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) <= -200000.0:
		tmp = x + t_1
	elif (x + y) <= 2e+40:
		tmp = (z * (1.0 - math.log(t))) + 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) <= -200000.0)
		tmp = Float64(x + t_1);
	elseif (Float64(x + y) <= 2e+40)
		tmp = Float64(Float64(z * Float64(1.0 - log(t))) + 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) <= -200000.0)
		tmp = x + t_1;
	elseif ((x + y) <= 2e+40)
		tmp = (z * (1.0 - log(t))) + 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], -200000.0], N[(x + t$95$1), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 2e+40], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 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 -200000:\\
\;\;\;\;x + t\_1\\

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

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


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

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

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

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

    if -2e5 < (+.f64 x y) < 2.00000000000000006e40

    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 b around inf 93.0%

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

    if 2.00000000000000006e40 < (+.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 x around 0 68.1%

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

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

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

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

Alternative 4: 60.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;x + y \leq -5 \cdot 10^{-8}:\\ \;\;\;\;x + t\_1\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{+40}:\\ \;\;\;\;z \cdot \left(1 - \log t\right) + a \cdot b\\ \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) -5e-8)
     (+ x t_1)
     (if (<= (+ x y) 2e+40) (+ (* z (- 1.0 (log t))) (* a b)) (+ y t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (a - 0.5);
	double tmp;
	if ((x + y) <= -5e-8) {
		tmp = x + t_1;
	} else if ((x + y) <= 2e+40) {
		tmp = (z * (1.0 - log(t))) + (a * b);
	} 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) <= (-5d-8)) then
        tmp = x + t_1
    else if ((x + y) <= 2d+40) then
        tmp = (z * (1.0d0 - log(t))) + (a * b)
    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) <= -5e-8) {
		tmp = x + t_1;
	} else if ((x + y) <= 2e+40) {
		tmp = (z * (1.0 - Math.log(t))) + (a * b);
	} 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) <= -5e-8:
		tmp = x + t_1
	elif (x + y) <= 2e+40:
		tmp = (z * (1.0 - math.log(t))) + (a * b)
	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) <= -5e-8)
		tmp = Float64(x + t_1);
	elseif (Float64(x + y) <= 2e+40)
		tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(a * b));
	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) <= -5e-8)
		tmp = x + t_1;
	elseif ((x + y) <= 2e+40)
		tmp = (z * (1.0 - log(t))) + (a * b);
	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], -5e-8], N[(x + t$95$1), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 2e+40], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $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 -5 \cdot 10^{-8}:\\
\;\;\;\;x + t\_1\\

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

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


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

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

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

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

    if -4.9999999999999998e-8 < (+.f64 x y) < 2.00000000000000006e40

    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 a around inf 78.4%

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

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

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

    if 2.00000000000000006e40 < (+.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 x around 0 68.1%

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

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

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

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

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

Alternative 5: 57.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;x + y \leq 10^{-225}:\\ \;\;\;\;x + t\_1\\ \mathbf{elif}\;x + y \leq 20:\\ \;\;\;\;z \cdot \left(1 - \log t\right) + -0.5 \cdot b\\ \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-225)
     (+ x t_1)
     (if (<= (+ x y) 20.0) (+ (* z (- 1.0 (log t))) (* -0.5 b)) (+ 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-225) {
		tmp = x + t_1;
	} else if ((x + y) <= 20.0) {
		tmp = (z * (1.0 - log(t))) + (-0.5 * b);
	} 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-225) then
        tmp = x + t_1
    else if ((x + y) <= 20.0d0) then
        tmp = (z * (1.0d0 - log(t))) + ((-0.5d0) * b)
    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-225) {
		tmp = x + t_1;
	} else if ((x + y) <= 20.0) {
		tmp = (z * (1.0 - Math.log(t))) + (-0.5 * b);
	} 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-225:
		tmp = x + t_1
	elif (x + y) <= 20.0:
		tmp = (z * (1.0 - math.log(t))) + (-0.5 * b)
	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-225)
		tmp = Float64(x + t_1);
	elseif (Float64(x + y) <= 20.0)
		tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(-0.5 * b));
	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-225)
		tmp = x + t_1;
	elseif ((x + y) <= 20.0)
		tmp = (z * (1.0 - log(t))) + (-0.5 * b);
	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-225], N[(x + t$95$1), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 20.0], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $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 10^{-225}:\\
\;\;\;\;x + t\_1\\

\mathbf{elif}\;x + y \leq 20:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + -0.5 \cdot b\\

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


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

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

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

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

    if 9.9999999999999996e-226 < (+.f64 x y) < 20

    1. Initial program 99.7%

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

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

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

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

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

    if 20 < (+.f64 x y)

    1. Initial program 99.9%

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

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

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

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

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

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

Alternative 6: 56.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;x + y \leq 10^{-225}:\\ \;\;\;\;x + t\_1\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{-22}:\\ \;\;\;\;x + z \cdot \left(1 - \log t\right)\\ \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-225)
     (+ x t_1)
     (if (<= (+ x y) 2e-22) (+ x (* z (- 1.0 (log t)))) (+ 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-225) {
		tmp = x + t_1;
	} else if ((x + y) <= 2e-22) {
		tmp = x + (z * (1.0 - log(t)));
	} 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-225) then
        tmp = x + t_1
    else if ((x + y) <= 2d-22) then
        tmp = x + (z * (1.0d0 - log(t)))
    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-225) {
		tmp = x + t_1;
	} else if ((x + y) <= 2e-22) {
		tmp = x + (z * (1.0 - Math.log(t)));
	} 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-225:
		tmp = x + t_1
	elif (x + y) <= 2e-22:
		tmp = x + (z * (1.0 - math.log(t)))
	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-225)
		tmp = Float64(x + t_1);
	elseif (Float64(x + y) <= 2e-22)
		tmp = Float64(x + Float64(z * Float64(1.0 - log(t))));
	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-225)
		tmp = x + t_1;
	elseif ((x + y) <= 2e-22)
		tmp = x + (z * (1.0 - log(t)));
	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-225], N[(x + t$95$1), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 2e-22], N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 10^{-225}:\\
\;\;\;\;x + t\_1\\

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

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


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

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

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

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

    if 9.9999999999999996e-226 < (+.f64 x y) < 2.0000000000000001e-22

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-22 < (+.f64 x y)

    1. Initial program 99.9%

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

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

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

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

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

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

Alternative 7: 78.1% accurate, 1.0× speedup?

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

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

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


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

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

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

    if -2e-165 < (+.f64 x y)

    1. Initial program 99.9%

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

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

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

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

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

Alternative 8: 72.4% accurate, 1.0× speedup?

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

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

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


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

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

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

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

    if -2e5 < (+.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 83.3%

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

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

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

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

Alternative 9: 87.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.45 \cdot 10^{+60} \lor \neg \left(b \leq 1.3 \cdot 10^{-26}\right):\\ \;\;\;\;b \cdot \left(\left(a + \left(\frac{x}{b} + \frac{y}{b}\right)\right) - 0.5\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
 (if (or (<= b -1.45e+60) (not (<= b 1.3e-26)))
   (* b (- (+ a (+ (/ x b) (/ y b))) 0.5))
   (+ (* z (- 1.0 (log t))) (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((b <= -1.45e+60) || !(b <= 1.3e-26)) {
		tmp = b * ((a + ((x / b) + (y / b))) - 0.5);
	} 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) :: tmp
    if ((b <= (-1.45d+60)) .or. (.not. (b <= 1.3d-26))) then
        tmp = b * ((a + ((x / b) + (y / b))) - 0.5d0)
    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 tmp;
	if ((b <= -1.45e+60) || !(b <= 1.3e-26)) {
		tmp = b * ((a + ((x / b) + (y / b))) - 0.5);
	} else {
		tmp = (z * (1.0 - Math.log(t))) + (x + y);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (b <= -1.45e+60) or not (b <= 1.3e-26):
		tmp = b * ((a + ((x / b) + (y / b))) - 0.5)
	else:
		tmp = (z * (1.0 - math.log(t))) + (x + y)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((b <= -1.45e+60) || !(b <= 1.3e-26))
		tmp = Float64(b * Float64(Float64(a + Float64(Float64(x / b) + Float64(y / b))) - 0.5));
	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)
	tmp = 0.0;
	if ((b <= -1.45e+60) || ~((b <= 1.3e-26)))
		tmp = b * ((a + ((x / b) + (y / b))) - 0.5);
	else
		tmp = (z * (1.0 - log(t))) + (x + y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.45e+60], N[Not[LessEqual[b, 1.3e-26]], $MachinePrecision]], N[(b * N[(N[(a + N[(N[(x / b), $MachinePrecision] + N[(y / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.5), $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}
\mathbf{if}\;b \leq -1.45 \cdot 10^{+60} \lor \neg \left(b \leq 1.3 \cdot 10^{-26}\right):\\
\;\;\;\;b \cdot \left(\left(a + \left(\frac{x}{b} + \frac{y}{b}\right)\right) - 0.5\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 b < -1.45e60 or 1.30000000000000005e-26 < 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 b around inf 99.8%

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

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

    if -1.45e60 < b < 1.30000000000000005e-26

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 55.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;x + y \leq 10^{-225}:\\ \;\;\;\;x + t\_1\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{-22}:\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \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-225)
     (+ x t_1)
     (if (<= (+ x y) 2e-22) (* z (- 1.0 (log t))) (+ 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-225) {
		tmp = x + t_1;
	} else if ((x + y) <= 2e-22) {
		tmp = z * (1.0 - log(t));
	} 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-225) then
        tmp = x + t_1
    else if ((x + y) <= 2d-22) then
        tmp = z * (1.0d0 - log(t))
    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-225) {
		tmp = x + t_1;
	} else if ((x + y) <= 2e-22) {
		tmp = z * (1.0 - Math.log(t));
	} 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-225:
		tmp = x + t_1
	elif (x + y) <= 2e-22:
		tmp = z * (1.0 - math.log(t))
	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-225)
		tmp = Float64(x + t_1);
	elseif (Float64(x + y) <= 2e-22)
		tmp = Float64(z * Float64(1.0 - log(t)));
	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-225)
		tmp = x + t_1;
	elseif ((x + y) <= 2e-22)
		tmp = z * (1.0 - log(t));
	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-225], N[(x + t$95$1), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 2e-22], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $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 10^{-225}:\\
\;\;\;\;x + t\_1\\

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

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


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

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

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

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

    if 9.9999999999999996e-226 < (+.f64 x y) < 2.0000000000000001e-22

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-22 < (+.f64 x y)

    1. Initial program 99.9%

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

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

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

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

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

Alternative 11: 99.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 12: 53.7% accurate, 6.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -4 \cdot 10^{+147}:\\
\;\;\;\;x + y\\

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

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


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

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

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

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

    if -3.9999999999999999e147 < (+.f64 x y) < 5.0000000000000001e26

    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 b around inf 84.7%

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

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

    if 5.0000000000000001e26 < (+.f64 x y)

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto y + \color{blue}{b \cdot a} \]
    9. Simplified53.5%

      \[\leadsto y + \color{blue}{b \cdot a} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification55.0%

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

Alternative 13: 61.9% accurate, 7.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.2 \cdot 10^{+82} \lor \neg \left(b \leq 1.9 \cdot 10^{-23}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.2000000000000001e82 or 1.90000000000000006e-23 < 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 b around inf 99.8%

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

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

    if -2.2000000000000001e82 < b < 1.90000000000000006e-23

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 58.0% accurate, 8.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;x + y \leq -2 \cdot 10^{-165}:\\ \;\;\;\;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) -2e-165) (+ 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) <= -2e-165) {
		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) <= (-2d-165)) 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) <= -2e-165) {
		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) <= -2e-165:
		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) <= -2e-165)
		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) <= -2e-165)
		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], -2e-165], 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 -2 \cdot 10^{-165}:\\
\;\;\;\;x + t\_1\\

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


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

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

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

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

    if -2e-165 < (+.f64 x y)

    1. Initial program 99.9%

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

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

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

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

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

Alternative 15: 54.8% accurate, 8.2× speedup?

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

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

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


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

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

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

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

    if 5.0000000000000001e26 < (+.f64 x y)

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto y + \color{blue}{b \cdot a} \]
    9. Simplified53.5%

      \[\leadsto y + \color{blue}{b \cdot a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.2%

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

Alternative 16: 51.6% accurate, 8.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.4 \cdot 10^{+107} \lor \neg \left(a \leq 10^{+75}\right):\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.4e107 or 9.99999999999999927e74 < a

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{b \cdot a} \]
    9. Simplified63.6%

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

    if -4.4e107 < a < 9.99999999999999927e74

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 28.2% accurate, 8.8× speedup?

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

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

\mathbf{elif}\;y \leq 5 \cdot 10^{+153}:\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 2.6999999999999999e-246

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

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

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

    if 2.6999999999999999e-246 < y < 5.00000000000000018e153

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{b \cdot a} \]
    9. Simplified33.9%

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

    if 5.00000000000000018e153 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

Alternative 18: 28.0% accurate, 19.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 16000000000000:\\
\;\;\;\;x\\

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


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

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

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

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

    if 1.6e13 < y

    1. Initial program 99.9%

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

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

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

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

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

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

Alternative 19: 22.4% 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 41.7%

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

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

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

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

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

Reproduce

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