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

Percentage Accurate: 99.9% → 99.9%
Time: 9.8s
Alternatives: 12
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 12 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, 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}
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. Add Preprocessing

Alternative 2: 92.6% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+157}:\\
\;\;\;\;\mathsf{fma}\left(1 - \log t, z, y\right) + \mathsf{fma}\left(-0.5, b, x\right)\\

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


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

    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 z around 0

      \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
    4. Step-by-step derivation
      1. associate-+r+N/A

        \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - \frac{1}{2}\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right) + \left(x + y\right)} \]
      3. *-commutativeN/A

        \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} + \left(x + y\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x + y\right)} \]
      5. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{a - \frac{1}{2}}, b, x + y\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, \color{blue}{y + x}\right) \]
      7. lower-+.f6489.2

        \[\leadsto \mathsf{fma}\left(a - 0.5, b, \color{blue}{y + x}\right) \]
    5. Applied rewrites89.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, y + x\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites89.2%

        \[\leadsto \mathsf{fma}\left(a - 0.5, b, x\right) + \color{blue}{y} \]
      2. Taylor expanded in b around inf

        \[\leadsto \color{blue}{b \cdot \left(\left(a + \left(\frac{x}{b} + \left(\frac{y}{b} + \frac{z}{b}\right)\right)\right) - \left(\frac{1}{2} + \frac{z \cdot \log t}{b}\right)\right)} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{\left(\left(a + \left(\frac{x}{b} + \left(\frac{y}{b} + \frac{z}{b}\right)\right)\right) - \left(\frac{1}{2} + \frac{z \cdot \log t}{b}\right)\right) \cdot b} \]
        2. lower-*.f64N/A

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

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

        \[\leadsto \left(\left(\frac{\left(z + y\right) + x}{b} + a\right) - \frac{1}{2}\right) \cdot b \]
      6. Step-by-step derivation
        1. Applied rewrites90.0%

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

        if -5.00000000000000049e198 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.99999999999999997e157

        1. Initial program 99.9%

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

          \[\leadsto \color{blue}{\left(x + \left(y + \left(z + \frac{-1}{2} \cdot b\right)\right)\right) - z \cdot \log t} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \left(x + \left(y + \left(z + \frac{-1}{2} \cdot b\right)\right)\right) - \color{blue}{\log t \cdot z} \]
          2. fp-cancel-sub-sign-invN/A

            \[\leadsto \color{blue}{\left(x + \left(y + \left(z + \frac{-1}{2} \cdot b\right)\right)\right) + \left(\mathsf{neg}\left(\log t\right)\right) \cdot z} \]
          3. mul-1-negN/A

            \[\leadsto \left(x + \left(y + \left(z + \frac{-1}{2} \cdot b\right)\right)\right) + \color{blue}{\left(-1 \cdot \log t\right)} \cdot z \]
          4. *-commutativeN/A

            \[\leadsto \left(x + \left(y + \left(z + \frac{-1}{2} \cdot b\right)\right)\right) + \color{blue}{z \cdot \left(-1 \cdot \log t\right)} \]
          5. mul-1-negN/A

            \[\leadsto \left(x + \left(y + \left(z + \frac{-1}{2} \cdot b\right)\right)\right) + z \cdot \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)} \]
          6. log-recN/A

            \[\leadsto \left(x + \left(y + \left(z + \frac{-1}{2} \cdot b\right)\right)\right) + z \cdot \color{blue}{\log \left(\frac{1}{t}\right)} \]
          7. +-commutativeN/A

            \[\leadsto \color{blue}{z \cdot \log \left(\frac{1}{t}\right) + \left(x + \left(y + \left(z + \frac{-1}{2} \cdot b\right)\right)\right)} \]
          8. +-commutativeN/A

            \[\leadsto z \cdot \log \left(\frac{1}{t}\right) + \color{blue}{\left(\left(y + \left(z + \frac{-1}{2} \cdot b\right)\right) + x\right)} \]
          9. associate-+r+N/A

            \[\leadsto z \cdot \log \left(\frac{1}{t}\right) + \left(\color{blue}{\left(\left(y + z\right) + \frac{-1}{2} \cdot b\right)} + x\right) \]
          10. associate-+l+N/A

            \[\leadsto z \cdot \log \left(\frac{1}{t}\right) + \color{blue}{\left(\left(y + z\right) + \left(\frac{-1}{2} \cdot b + x\right)\right)} \]
          11. associate-+r+N/A

            \[\leadsto \color{blue}{\left(z \cdot \log \left(\frac{1}{t}\right) + \left(y + z\right)\right) + \left(\frac{-1}{2} \cdot b + x\right)} \]
          12. +-commutativeN/A

            \[\leadsto \color{blue}{\left(\left(y + z\right) + z \cdot \log \left(\frac{1}{t}\right)\right)} + \left(\frac{-1}{2} \cdot b + x\right) \]
          13. log-recN/A

            \[\leadsto \left(\left(y + z\right) + z \cdot \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)}\right) + \left(\frac{-1}{2} \cdot b + x\right) \]
          14. mul-1-negN/A

            \[\leadsto \left(\left(y + z\right) + z \cdot \color{blue}{\left(-1 \cdot \log t\right)}\right) + \left(\frac{-1}{2} \cdot b + x\right) \]
          15. *-commutativeN/A

            \[\leadsto \left(\left(y + z\right) + \color{blue}{\left(-1 \cdot \log t\right) \cdot z}\right) + \left(\frac{-1}{2} \cdot b + x\right) \]
          16. mul-1-negN/A

            \[\leadsto \left(\left(y + z\right) + \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)} \cdot z\right) + \left(\frac{-1}{2} \cdot b + x\right) \]
          17. fp-cancel-sub-sign-invN/A

            \[\leadsto \color{blue}{\left(\left(y + z\right) - \log t \cdot z\right)} + \left(\frac{-1}{2} \cdot b + x\right) \]
          18. *-commutativeN/A

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

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

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

        1. Initial program 100.0%

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

          \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
        4. Step-by-step derivation
          1. associate-+r+N/A

            \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - \frac{1}{2}\right)} \]
          2. +-commutativeN/A

            \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right) + \left(x + y\right)} \]
          3. *-commutativeN/A

            \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} + \left(x + y\right) \]
          4. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x + y\right)} \]
          5. lower--.f64N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{a - \frac{1}{2}}, b, x + y\right) \]
          6. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, \color{blue}{y + x}\right) \]
          7. lower-+.f6494.2

            \[\leadsto \mathsf{fma}\left(a - 0.5, b, \color{blue}{y + x}\right) \]
        5. Applied rewrites94.2%

          \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, y + x\right)} \]
        6. Step-by-step derivation
          1. Applied rewrites94.2%

            \[\leadsto \mathsf{fma}\left(a - 0.5, b, x\right) + \color{blue}{y} \]
        7. Recombined 3 regimes into one program.
        8. Add Preprocessing

        Alternative 3: 57.6% accurate, 1.0× speedup?

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

          1. Initial program 99.9%

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

            \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
          4. Step-by-step derivation
            1. associate-+r+N/A

              \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - \frac{1}{2}\right)} \]
            2. +-commutativeN/A

              \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right) + \left(x + y\right)} \]
            3. *-commutativeN/A

              \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} + \left(x + y\right) \]
            4. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x + y\right)} \]
            5. lower--.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{a - \frac{1}{2}}, b, x + y\right) \]
            6. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, \color{blue}{y + x}\right) \]
            7. lower-+.f6470.4

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, y + x\right)} \]
          6. Taylor expanded in y around 0

            \[\leadsto x + \color{blue}{b \cdot \left(a - \frac{1}{2}\right)} \]
          7. Step-by-step derivation
            1. Applied rewrites52.5%

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

            if -2e-107 < (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t)))

            1. Initial program 99.9%

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

              \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
            4. Step-by-step derivation
              1. associate-+r+N/A

                \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - \frac{1}{2}\right)} \]
              2. +-commutativeN/A

                \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right) + \left(x + y\right)} \]
              3. *-commutativeN/A

                \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} + \left(x + y\right) \]
              4. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x + y\right)} \]
              5. lower--.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{a - \frac{1}{2}}, b, x + y\right) \]
              6. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, \color{blue}{y + x}\right) \]
              7. lower-+.f6479.3

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, y + x\right)} \]
            6. Taylor expanded in x around 0

              \[\leadsto y + \color{blue}{b \cdot \left(a - \frac{1}{2}\right)} \]
            7. Step-by-step derivation
              1. Applied rewrites53.5%

                \[\leadsto \mathsf{fma}\left(b, \color{blue}{a - 0.5}, y\right) \]
            8. Recombined 2 regimes into one program.
            9. Final simplification53.1%

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

            Alternative 4: 87.0% accurate, 1.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.06 \cdot 10^{+153} \lor \neg \left(z \leq 2.3 \cdot 10^{+134}\right):\\ \;\;\;\;\mathsf{fma}\left(1 - \log t, z, \mathsf{fma}\left(-0.5, b, y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, x\right) + y\\ \end{array} \end{array} \]
            (FPCore (x y z t a b)
             :precision binary64
             (if (or (<= z -1.06e+153) (not (<= z 2.3e+134)))
               (fma (- 1.0 (log t)) z (fma -0.5 b y))
               (+ (fma (- a 0.5) b x) y)))
            double code(double x, double y, double z, double t, double a, double b) {
            	double tmp;
            	if ((z <= -1.06e+153) || !(z <= 2.3e+134)) {
            		tmp = fma((1.0 - log(t)), z, fma(-0.5, b, y));
            	} else {
            		tmp = fma((a - 0.5), b, x) + y;
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a, b)
            	tmp = 0.0
            	if ((z <= -1.06e+153) || !(z <= 2.3e+134))
            		tmp = fma(Float64(1.0 - log(t)), z, fma(-0.5, b, y));
            	else
            		tmp = Float64(fma(Float64(a - 0.5), b, x) + y);
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.06e+153], N[Not[LessEqual[z, 2.3e+134]], $MachinePrecision]], N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + N[(-0.5 * b + y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a - 0.5), $MachinePrecision] * b + x), $MachinePrecision] + y), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;z \leq -1.06 \cdot 10^{+153} \lor \neg \left(z \leq 2.3 \cdot 10^{+134}\right):\\
            \;\;\;\;\mathsf{fma}\left(1 - \log t, z, \mathsf{fma}\left(-0.5, b, y\right)\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(a - 0.5, b, x\right) + y\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -1.05999999999999995e153 or 2.2999999999999998e134 < z

              1. Initial program 99.8%

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

                \[\leadsto \color{blue}{\left(x + \left(y + \left(z + \frac{-1}{2} \cdot b\right)\right)\right) - z \cdot \log t} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \left(x + \left(y + \left(z + \frac{-1}{2} \cdot b\right)\right)\right) - \color{blue}{\log t \cdot z} \]
                2. fp-cancel-sub-sign-invN/A

                  \[\leadsto \color{blue}{\left(x + \left(y + \left(z + \frac{-1}{2} \cdot b\right)\right)\right) + \left(\mathsf{neg}\left(\log t\right)\right) \cdot z} \]
                3. mul-1-negN/A

                  \[\leadsto \left(x + \left(y + \left(z + \frac{-1}{2} \cdot b\right)\right)\right) + \color{blue}{\left(-1 \cdot \log t\right)} \cdot z \]
                4. *-commutativeN/A

                  \[\leadsto \left(x + \left(y + \left(z + \frac{-1}{2} \cdot b\right)\right)\right) + \color{blue}{z \cdot \left(-1 \cdot \log t\right)} \]
                5. mul-1-negN/A

                  \[\leadsto \left(x + \left(y + \left(z + \frac{-1}{2} \cdot b\right)\right)\right) + z \cdot \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)} \]
                6. log-recN/A

                  \[\leadsto \left(x + \left(y + \left(z + \frac{-1}{2} \cdot b\right)\right)\right) + z \cdot \color{blue}{\log \left(\frac{1}{t}\right)} \]
                7. +-commutativeN/A

                  \[\leadsto \color{blue}{z \cdot \log \left(\frac{1}{t}\right) + \left(x + \left(y + \left(z + \frac{-1}{2} \cdot b\right)\right)\right)} \]
                8. +-commutativeN/A

                  \[\leadsto z \cdot \log \left(\frac{1}{t}\right) + \color{blue}{\left(\left(y + \left(z + \frac{-1}{2} \cdot b\right)\right) + x\right)} \]
                9. associate-+r+N/A

                  \[\leadsto z \cdot \log \left(\frac{1}{t}\right) + \left(\color{blue}{\left(\left(y + z\right) + \frac{-1}{2} \cdot b\right)} + x\right) \]
                10. associate-+l+N/A

                  \[\leadsto z \cdot \log \left(\frac{1}{t}\right) + \color{blue}{\left(\left(y + z\right) + \left(\frac{-1}{2} \cdot b + x\right)\right)} \]
                11. associate-+r+N/A

                  \[\leadsto \color{blue}{\left(z \cdot \log \left(\frac{1}{t}\right) + \left(y + z\right)\right) + \left(\frac{-1}{2} \cdot b + x\right)} \]
                12. +-commutativeN/A

                  \[\leadsto \color{blue}{\left(\left(y + z\right) + z \cdot \log \left(\frac{1}{t}\right)\right)} + \left(\frac{-1}{2} \cdot b + x\right) \]
                13. log-recN/A

                  \[\leadsto \left(\left(y + z\right) + z \cdot \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)}\right) + \left(\frac{-1}{2} \cdot b + x\right) \]
                14. mul-1-negN/A

                  \[\leadsto \left(\left(y + z\right) + z \cdot \color{blue}{\left(-1 \cdot \log t\right)}\right) + \left(\frac{-1}{2} \cdot b + x\right) \]
                15. *-commutativeN/A

                  \[\leadsto \left(\left(y + z\right) + \color{blue}{\left(-1 \cdot \log t\right) \cdot z}\right) + \left(\frac{-1}{2} \cdot b + x\right) \]
                16. mul-1-negN/A

                  \[\leadsto \left(\left(y + z\right) + \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)} \cdot z\right) + \left(\frac{-1}{2} \cdot b + x\right) \]
                17. fp-cancel-sub-sign-invN/A

                  \[\leadsto \color{blue}{\left(\left(y + z\right) - \log t \cdot z\right)} + \left(\frac{-1}{2} \cdot b + x\right) \]
                18. *-commutativeN/A

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(1 - \log t, z, y\right) + \mathsf{fma}\left(-0.5, b, x\right)} \]
              6. Taylor expanded in x around 0

                \[\leadsto y + \color{blue}{\left(\frac{-1}{2} \cdot b + z \cdot \left(1 - \log t\right)\right)} \]
              7. Step-by-step derivation
                1. Applied rewrites91.7%

                  \[\leadsto \mathsf{fma}\left(1 - \log t, \color{blue}{z}, \mathsf{fma}\left(-0.5, b, y\right)\right) \]

                if -1.05999999999999995e153 < z < 2.2999999999999998e134

                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 z around 0

                  \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                4. Step-by-step derivation
                  1. associate-+r+N/A

                    \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - \frac{1}{2}\right)} \]
                  2. +-commutativeN/A

                    \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right) + \left(x + y\right)} \]
                  3. *-commutativeN/A

                    \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} + \left(x + y\right) \]
                  4. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x + y\right)} \]
                  5. lower--.f64N/A

                    \[\leadsto \mathsf{fma}\left(\color{blue}{a - \frac{1}{2}}, b, x + y\right) \]
                  6. +-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, \color{blue}{y + x}\right) \]
                  7. lower-+.f6492.6

                    \[\leadsto \mathsf{fma}\left(a - 0.5, b, \color{blue}{y + x}\right) \]
                5. Applied rewrites92.6%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, y + x\right)} \]
                6. Step-by-step derivation
                  1. Applied rewrites92.6%

                    \[\leadsto \mathsf{fma}\left(a - 0.5, b, x\right) + \color{blue}{y} \]
                7. Recombined 2 regimes into one program.
                8. Final simplification92.4%

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

                Alternative 5: 88.1% accurate, 1.0× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.06 \cdot 10^{+153} \lor \neg \left(z \leq 3.6 \cdot 10^{+138}\right):\\ \;\;\;\;\left(\left(z + y\right) + x\right) - \log t \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, x\right) + y\\ \end{array} \end{array} \]
                (FPCore (x y z t a b)
                 :precision binary64
                 (if (or (<= z -1.06e+153) (not (<= z 3.6e+138)))
                   (- (+ (+ z y) x) (* (log t) z))
                   (+ (fma (- a 0.5) b x) y)))
                double code(double x, double y, double z, double t, double a, double b) {
                	double tmp;
                	if ((z <= -1.06e+153) || !(z <= 3.6e+138)) {
                		tmp = ((z + y) + x) - (log(t) * z);
                	} else {
                		tmp = fma((a - 0.5), b, x) + y;
                	}
                	return tmp;
                }
                
                function code(x, y, z, t, a, b)
                	tmp = 0.0
                	if ((z <= -1.06e+153) || !(z <= 3.6e+138))
                		tmp = Float64(Float64(Float64(z + y) + x) - Float64(log(t) * z));
                	else
                		tmp = Float64(fma(Float64(a - 0.5), b, x) + y);
                	end
                	return tmp
                end
                
                code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.06e+153], N[Not[LessEqual[z, 3.6e+138]], $MachinePrecision]], N[(N[(N[(z + y), $MachinePrecision] + x), $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a - 0.5), $MachinePrecision] * b + x), $MachinePrecision] + y), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;z \leq -1.06 \cdot 10^{+153} \lor \neg \left(z \leq 3.6 \cdot 10^{+138}\right):\\
                \;\;\;\;\left(\left(z + y\right) + x\right) - \log t \cdot z\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(a - 0.5, b, x\right) + y\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if z < -1.05999999999999995e153 or 3.6000000000000001e138 < z

                  1. Initial program 99.8%

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

                    \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                  4. Step-by-step derivation
                    1. associate-+r+N/A

                      \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - \frac{1}{2}\right)} \]
                    2. +-commutativeN/A

                      \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right) + \left(x + y\right)} \]
                    3. *-commutativeN/A

                      \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} + \left(x + y\right) \]
                    4. lower-fma.f64N/A

                      \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x + y\right)} \]
                    5. lower--.f64N/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{a - \frac{1}{2}}, b, x + y\right) \]
                    6. +-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, \color{blue}{y + x}\right) \]
                    7. lower-+.f6421.7

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

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

                      \[\leadsto \mathsf{fma}\left(a - 0.5, b, x\right) + \color{blue}{y} \]
                    2. Taylor expanded in b around 0

                      \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
                    3. Step-by-step derivation
                      1. lower--.f64N/A

                        \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
                      2. +-commutativeN/A

                        \[\leadsto \color{blue}{\left(\left(y + z\right) + x\right)} - z \cdot \log t \]
                      3. lower-+.f64N/A

                        \[\leadsto \color{blue}{\left(\left(y + z\right) + x\right)} - z \cdot \log t \]
                      4. +-commutativeN/A

                        \[\leadsto \left(\color{blue}{\left(z + y\right)} + x\right) - z \cdot \log t \]
                      5. lower-+.f64N/A

                        \[\leadsto \left(\color{blue}{\left(z + y\right)} + x\right) - z \cdot \log t \]
                      6. *-commutativeN/A

                        \[\leadsto \left(\left(z + y\right) + x\right) - \color{blue}{\log t \cdot z} \]
                      7. lower-*.f64N/A

                        \[\leadsto \left(\left(z + y\right) + x\right) - \color{blue}{\log t \cdot z} \]
                      8. lower-log.f6492.4

                        \[\leadsto \left(\left(z + y\right) + x\right) - \color{blue}{\log t} \cdot z \]
                    4. Applied rewrites92.4%

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

                    if -1.05999999999999995e153 < z < 3.6000000000000001e138

                    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 z around 0

                      \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                    4. Step-by-step derivation
                      1. associate-+r+N/A

                        \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - \frac{1}{2}\right)} \]
                      2. +-commutativeN/A

                        \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right) + \left(x + y\right)} \]
                      3. *-commutativeN/A

                        \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} + \left(x + y\right) \]
                      4. lower-fma.f64N/A

                        \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x + y\right)} \]
                      5. lower--.f64N/A

                        \[\leadsto \mathsf{fma}\left(\color{blue}{a - \frac{1}{2}}, b, x + y\right) \]
                      6. +-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, \color{blue}{y + x}\right) \]
                      7. lower-+.f6492.7

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

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

                        \[\leadsto \mathsf{fma}\left(a - 0.5, b, x\right) + \color{blue}{y} \]
                    7. Recombined 2 regimes into one program.
                    8. Final simplification92.6%

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

                    Alternative 6: 83.4% accurate, 1.0× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+156} \lor \neg \left(z \leq 1.75 \cdot 10^{+155}\right):\\ \;\;\;\;\left(1 - \log t\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, x\right) + y\\ \end{array} \end{array} \]
                    (FPCore (x y z t a b)
                     :precision binary64
                     (if (or (<= z -2.2e+156) (not (<= z 1.75e+155)))
                       (* (- 1.0 (log t)) z)
                       (+ (fma (- a 0.5) b x) y)))
                    double code(double x, double y, double z, double t, double a, double b) {
                    	double tmp;
                    	if ((z <= -2.2e+156) || !(z <= 1.75e+155)) {
                    		tmp = (1.0 - log(t)) * z;
                    	} else {
                    		tmp = fma((a - 0.5), b, x) + y;
                    	}
                    	return tmp;
                    }
                    
                    function code(x, y, z, t, a, b)
                    	tmp = 0.0
                    	if ((z <= -2.2e+156) || !(z <= 1.75e+155))
                    		tmp = Float64(Float64(1.0 - log(t)) * z);
                    	else
                    		tmp = Float64(fma(Float64(a - 0.5), b, x) + y);
                    	end
                    	return tmp
                    end
                    
                    code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.2e+156], N[Not[LessEqual[z, 1.75e+155]], $MachinePrecision]], N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(N[(N[(a - 0.5), $MachinePrecision] * b + x), $MachinePrecision] + y), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;z \leq -2.2 \cdot 10^{+156} \lor \neg \left(z \leq 1.75 \cdot 10^{+155}\right):\\
                    \;\;\;\;\left(1 - \log t\right) \cdot z\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\mathsf{fma}\left(a - 0.5, b, x\right) + y\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if z < -2.20000000000000004e156 or 1.74999999999999992e155 < z

                      1. Initial program 99.7%

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

                        \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right)} \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \color{blue}{\left(1 - \log t\right) \cdot z} \]
                        2. lower-*.f64N/A

                          \[\leadsto \color{blue}{\left(1 - \log t\right) \cdot z} \]
                        3. lower--.f64N/A

                          \[\leadsto \color{blue}{\left(1 - \log t\right)} \cdot z \]
                        4. lower-log.f6478.7

                          \[\leadsto \left(1 - \color{blue}{\log t}\right) \cdot z \]
                      5. Applied rewrites78.7%

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

                      if -2.20000000000000004e156 < z < 1.74999999999999992e155

                      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 z around 0

                        \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                      4. Step-by-step derivation
                        1. associate-+r+N/A

                          \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - \frac{1}{2}\right)} \]
                        2. +-commutativeN/A

                          \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right) + \left(x + y\right)} \]
                        3. *-commutativeN/A

                          \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} + \left(x + y\right) \]
                        4. lower-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x + y\right)} \]
                        5. lower--.f64N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{a - \frac{1}{2}}, b, x + y\right) \]
                        6. +-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, \color{blue}{y + x}\right) \]
                        7. lower-+.f6492.3

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

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

                          \[\leadsto \mathsf{fma}\left(a - 0.5, b, x\right) + \color{blue}{y} \]
                      7. Recombined 2 regimes into one program.
                      8. Final simplification89.1%

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

                      Alternative 7: 61.6% accurate, 3.4× speedup?

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

                        1. Initial program 100.0%

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

                          \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                        4. Step-by-step derivation
                          1. associate-+r+N/A

                            \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - \frac{1}{2}\right)} \]
                          2. +-commutativeN/A

                            \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right) + \left(x + y\right)} \]
                          3. *-commutativeN/A

                            \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} + \left(x + y\right) \]
                          4. lower-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x + y\right)} \]
                          5. lower--.f64N/A

                            \[\leadsto \mathsf{fma}\left(\color{blue}{a - \frac{1}{2}}, b, x + y\right) \]
                          6. +-commutativeN/A

                            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, \color{blue}{y + x}\right) \]
                          7. lower-+.f6492.2

                            \[\leadsto \mathsf{fma}\left(a - 0.5, b, \color{blue}{y + x}\right) \]
                        5. Applied rewrites92.2%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, y + x\right)} \]
                        6. Step-by-step derivation
                          1. Applied rewrites92.2%

                            \[\leadsto \mathsf{fma}\left(a - 0.5, b, x\right) + \color{blue}{y} \]
                          2. Taylor expanded in b around inf

                            \[\leadsto \color{blue}{b \cdot \left(\left(a + \left(\frac{x}{b} + \left(\frac{y}{b} + \frac{z}{b}\right)\right)\right) - \left(\frac{1}{2} + \frac{z \cdot \log t}{b}\right)\right)} \]
                          3. Step-by-step derivation
                            1. *-commutativeN/A

                              \[\leadsto \color{blue}{\left(\left(a + \left(\frac{x}{b} + \left(\frac{y}{b} + \frac{z}{b}\right)\right)\right) - \left(\frac{1}{2} + \frac{z \cdot \log t}{b}\right)\right) \cdot b} \]
                            2. lower-*.f64N/A

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

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

                            \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right)} \]
                          6. Step-by-step derivation
                            1. *-commutativeN/A

                              \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} \]
                            2. lower-*.f64N/A

                              \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} \]
                            3. lower--.f6488.9

                              \[\leadsto \color{blue}{\left(a - 0.5\right)} \cdot b \]
                          7. Applied rewrites88.9%

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

                          if -5.00000000000000028e257 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 5.0000000000000002e206

                          1. Initial program 99.9%

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

                            \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                          4. Step-by-step derivation
                            1. associate-+r+N/A

                              \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - \frac{1}{2}\right)} \]
                            2. +-commutativeN/A

                              \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right) + \left(x + y\right)} \]
                            3. *-commutativeN/A

                              \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} + \left(x + y\right) \]
                            4. lower-fma.f64N/A

                              \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x + y\right)} \]
                            5. lower--.f64N/A

                              \[\leadsto \mathsf{fma}\left(\color{blue}{a - \frac{1}{2}}, b, x + y\right) \]
                            6. +-commutativeN/A

                              \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, \color{blue}{y + x}\right) \]
                            7. lower-+.f6470.2

                              \[\leadsto \mathsf{fma}\left(a - 0.5, b, \color{blue}{y + x}\right) \]
                          5. Applied rewrites70.2%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, y + x\right)} \]
                          6. Step-by-step derivation
                            1. Applied rewrites70.2%

                              \[\leadsto \mathsf{fma}\left(a - 0.5, b, x\right) + \color{blue}{y} \]
                            2. Taylor expanded in b around 0

                              \[\leadsto x + \color{blue}{y} \]
                            3. Step-by-step derivation
                              1. Applied rewrites54.4%

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

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

                            Alternative 8: 56.8% accurate, 3.7× speedup?

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

                              1. Initial program 100.0%

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

                                \[\leadsto \color{blue}{a \cdot b} \]
                              4. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto \color{blue}{b \cdot a} \]
                                2. lower-*.f6471.3

                                  \[\leadsto \color{blue}{b \cdot a} \]
                              5. Applied rewrites71.3%

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

                              if -5.00000000000000028e257 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 5.0000000000000002e206

                              1. Initial program 99.9%

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

                                \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                              4. Step-by-step derivation
                                1. associate-+r+N/A

                                  \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - \frac{1}{2}\right)} \]
                                2. +-commutativeN/A

                                  \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right) + \left(x + y\right)} \]
                                3. *-commutativeN/A

                                  \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} + \left(x + y\right) \]
                                4. lower-fma.f64N/A

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x + y\right)} \]
                                5. lower--.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{a - \frac{1}{2}}, b, x + y\right) \]
                                6. +-commutativeN/A

                                  \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, \color{blue}{y + x}\right) \]
                                7. lower-+.f6470.2

                                  \[\leadsto \mathsf{fma}\left(a - 0.5, b, \color{blue}{y + x}\right) \]
                              5. Applied rewrites70.2%

                                \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, y + x\right)} \]
                              6. Step-by-step derivation
                                1. Applied rewrites70.2%

                                  \[\leadsto \mathsf{fma}\left(a - 0.5, b, x\right) + \color{blue}{y} \]
                                2. Taylor expanded in b around 0

                                  \[\leadsto x + \color{blue}{y} \]
                                3. Step-by-step derivation
                                  1. Applied rewrites54.4%

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

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

                                Alternative 9: 44.6% accurate, 5.2× speedup?

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

                                  1. Initial program 99.9%

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

                                    \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                                  4. Step-by-step derivation
                                    1. associate-+r+N/A

                                      \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - \frac{1}{2}\right)} \]
                                    2. +-commutativeN/A

                                      \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right) + \left(x + y\right)} \]
                                    3. *-commutativeN/A

                                      \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} + \left(x + y\right) \]
                                    4. lower-fma.f64N/A

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x + y\right)} \]
                                    5. lower--.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\color{blue}{a - \frac{1}{2}}, b, x + y\right) \]
                                    6. +-commutativeN/A

                                      \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, \color{blue}{y + x}\right) \]
                                    7. lower-+.f6481.7

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

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

                                      \[\leadsto \mathsf{fma}\left(a - 0.5, b, x\right) + \color{blue}{y} \]
                                    2. Taylor expanded in b around 0

                                      \[\leadsto x + \color{blue}{y} \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites57.3%

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

                                      if -5.00000000000000015e39 < (+.f64 x y) < 5e12

                                      1. Initial program 99.9%

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

                                        \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                                      4. Step-by-step derivation
                                        1. associate-+r+N/A

                                          \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - \frac{1}{2}\right)} \]
                                        2. +-commutativeN/A

                                          \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right) + \left(x + y\right)} \]
                                        3. *-commutativeN/A

                                          \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} + \left(x + y\right) \]
                                        4. lower-fma.f64N/A

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x + y\right)} \]
                                        5. lower--.f64N/A

                                          \[\leadsto \mathsf{fma}\left(\color{blue}{a - \frac{1}{2}}, b, x + y\right) \]
                                        6. +-commutativeN/A

                                          \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, \color{blue}{y + x}\right) \]
                                        7. lower-+.f6460.6

                                          \[\leadsto \mathsf{fma}\left(a - 0.5, b, \color{blue}{y + x}\right) \]
                                      5. Applied rewrites60.6%

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, y + x\right)} \]
                                      6. Step-by-step derivation
                                        1. Applied rewrites49.6%

                                          \[\leadsto \frac{\mathsf{fma}\left(\left(a \cdot a - 0.25\right) \cdot b, y - x, \left(0.5 + a\right) \cdot \left(\left(y + x\right) \cdot \left(y - x\right)\right)\right)}{\color{blue}{\left(0.5 + a\right) \cdot \left(y - x\right)}} \]
                                        2. Taylor expanded in b around inf

                                          \[\leadsto \frac{b \cdot \left({a}^{2} - \frac{1}{4}\right)}{\color{blue}{\frac{1}{2} + a}} \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites42.8%

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

                                            \[\leadsto \frac{-1}{2} \cdot b \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites24.3%

                                              \[\leadsto -0.5 \cdot b \]
                                          4. Recombined 2 regimes into one program.
                                          5. Final simplification47.1%

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

                                          Alternative 10: 57.6% accurate, 6.6× speedup?

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

                                            1. Initial program 99.9%

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

                                              \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                                            4. Step-by-step derivation
                                              1. associate-+r+N/A

                                                \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - \frac{1}{2}\right)} \]
                                              2. +-commutativeN/A

                                                \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right) + \left(x + y\right)} \]
                                              3. *-commutativeN/A

                                                \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} + \left(x + y\right) \]
                                              4. lower-fma.f64N/A

                                                \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x + y\right)} \]
                                              5. lower--.f64N/A

                                                \[\leadsto \mathsf{fma}\left(\color{blue}{a - \frac{1}{2}}, b, x + y\right) \]
                                              6. +-commutativeN/A

                                                \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, \color{blue}{y + x}\right) \]
                                              7. lower-+.f6471.7

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

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, y + x\right)} \]
                                            6. Taylor expanded in y around 0

                                              \[\leadsto x + \color{blue}{b \cdot \left(a - \frac{1}{2}\right)} \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites59.0%

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

                                              if 5e52 < (+.f64 x y)

                                              1. Initial program 99.9%

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

                                                \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                                              4. Step-by-step derivation
                                                1. associate-+r+N/A

                                                  \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - \frac{1}{2}\right)} \]
                                                2. +-commutativeN/A

                                                  \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right) + \left(x + y\right)} \]
                                                3. *-commutativeN/A

                                                  \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} + \left(x + y\right) \]
                                                4. lower-fma.f64N/A

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x + y\right)} \]
                                                5. lower--.f64N/A

                                                  \[\leadsto \mathsf{fma}\left(\color{blue}{a - \frac{1}{2}}, b, x + y\right) \]
                                                6. +-commutativeN/A

                                                  \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, \color{blue}{y + x}\right) \]
                                                7. lower-+.f6481.8

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

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

                                                  \[\leadsto \mathsf{fma}\left(a - 0.5, b, x\right) + \color{blue}{y} \]
                                                2. Taylor expanded in b around 0

                                                  \[\leadsto x + \color{blue}{y} \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites61.8%

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

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

                                                Alternative 11: 77.6% accurate, 9.7× speedup?

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

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

                                                  \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                                                4. Step-by-step derivation
                                                  1. associate-+r+N/A

                                                    \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - \frac{1}{2}\right)} \]
                                                  2. +-commutativeN/A

                                                    \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right) + \left(x + y\right)} \]
                                                  3. *-commutativeN/A

                                                    \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} + \left(x + y\right) \]
                                                  4. lower-fma.f64N/A

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x + y\right)} \]
                                                  5. lower--.f64N/A

                                                    \[\leadsto \mathsf{fma}\left(\color{blue}{a - \frac{1}{2}}, b, x + y\right) \]
                                                  6. +-commutativeN/A

                                                    \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, \color{blue}{y + x}\right) \]
                                                  7. lower-+.f6475.2

                                                    \[\leadsto \mathsf{fma}\left(a - 0.5, b, \color{blue}{y + x}\right) \]
                                                5. Applied rewrites75.2%

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, y + x\right)} \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites75.2%

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

                                                  Alternative 12: 41.8% accurate, 31.5× speedup?

                                                  \[\begin{array}{l} \\ y + x \end{array} \]
                                                  (FPCore (x y z t a b) :precision binary64 (+ y x))
                                                  double code(double x, double y, double z, double t, double a, double b) {
                                                  	return y + 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 = y + x
                                                  end function
                                                  
                                                  public static double code(double x, double y, double z, double t, double a, double b) {
                                                  	return y + x;
                                                  }
                                                  
                                                  def code(x, y, z, t, a, b):
                                                  	return y + x
                                                  
                                                  function code(x, y, z, t, a, b)
                                                  	return Float64(y + x)
                                                  end
                                                  
                                                  function tmp = code(x, y, z, t, a, b)
                                                  	tmp = y + x;
                                                  end
                                                  
                                                  code[x_, y_, z_, t_, a_, b_] := N[(y + x), $MachinePrecision]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  y + 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. Add Preprocessing
                                                  3. Taylor expanded in z around 0

                                                    \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                                                  4. Step-by-step derivation
                                                    1. associate-+r+N/A

                                                      \[\leadsto \color{blue}{\left(x + y\right) + b \cdot \left(a - \frac{1}{2}\right)} \]
                                                    2. +-commutativeN/A

                                                      \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right) + \left(x + y\right)} \]
                                                    3. *-commutativeN/A

                                                      \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} + \left(x + y\right) \]
                                                    4. lower-fma.f64N/A

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x + y\right)} \]
                                                    5. lower--.f64N/A

                                                      \[\leadsto \mathsf{fma}\left(\color{blue}{a - \frac{1}{2}}, b, x + y\right) \]
                                                    6. +-commutativeN/A

                                                      \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, \color{blue}{y + x}\right) \]
                                                    7. lower-+.f6475.2

                                                      \[\leadsto \mathsf{fma}\left(a - 0.5, b, \color{blue}{y + x}\right) \]
                                                  5. Applied rewrites75.2%

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, y + x\right)} \]
                                                  6. Step-by-step derivation
                                                    1. Applied rewrites75.2%

                                                      \[\leadsto \mathsf{fma}\left(a - 0.5, b, x\right) + \color{blue}{y} \]
                                                    2. Taylor expanded in b around 0

                                                      \[\leadsto x + \color{blue}{y} \]
                                                    3. Step-by-step derivation
                                                      1. Applied rewrites42.9%

                                                        \[\leadsto y + \color{blue}{x} \]
                                                      2. Add Preprocessing

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

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

                                                      Reproduce

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