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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 99.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) + \mathsf{fma}\left(b, a, b \cdot -0.5\right) \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (+ (+ x y) z) (* z (log t))) (fma b a (* b -0.5))))
double code(double x, double y, double z, double t, double a, double b) {
	return (((x + y) + z) - (z * log(t))) + fma(b, a, (b * -0.5));
}
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + fma(b, a, Float64(b * -0.5)))
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[(b * a + N[(b * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

Alternative 2: 89.6% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000005e149 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 4.9999999999999998e86

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-invN/A

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

        \[\leadsto \color{blue}{\left(\left(x + y\right) + z\right)} + \left(\mathsf{neg}\left(z\right)\right) \cdot \log t \]
      3. associate-+l+N/A

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

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

        \[\leadsto \left(x + y\right) + \left(\color{blue}{z \cdot 1} - z \cdot \log t\right) \]
      6. distribute-lft-out--N/A

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, 1 + -1 \cdot \log t, x + y\right)} \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(z, 1 + \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)}, x + y\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{1 - \log t}, x + y\right) \]
      13. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{1 - \log t}, x + y\right) \]
      14. lower-log.f64N/A

        \[\leadsto \mathsf{fma}\left(z, 1 - \color{blue}{\log t}, x + y\right) \]
      15. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
      16. lower-+.f6490.7

        \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
    5. Applied rewrites90.7%

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

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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 88.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a + -0.5, b, z - z \cdot \log t\right)\\
\mathbf{if}\;z \leq -5.6 \cdot 10^{+160}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2.9 \cdot 10^{+206}:\\
\;\;\;\;\mathsf{fma}\left(b, a, b \cdot -0.5\right) + \left(x + y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.5999999999999999e160 or 2.9e206 < z

    1. Initial program 99.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{x}{y} + \left(\frac{z}{y} - \frac{z \cdot \log t}{y}\right), y\right)} + \left(a - 0.5\right) \cdot b \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, \mathsf{fma}\left(y, \frac{x}{y} + \left(\frac{z}{y} - \frac{z \cdot \log t}{y}\right), y\right)\right)} \]
      5. lift--.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{a + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, b, \mathsf{fma}\left(y, \frac{x}{y} + \left(\frac{z}{y} - \frac{z \cdot \log t}{y}\right), y\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a + \color{blue}{\frac{-1}{2}}, b, \mathsf{fma}\left(y, \frac{x}{y} + \left(\frac{z}{y} - \frac{z \cdot \log t}{y}\right), y\right)\right) \]
      8. lift-+.f6466.7

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

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

      \[\leadsto \mathsf{fma}\left(a + \frac{-1}{2}, b, z \cdot \color{blue}{\left(1 - \log t\right)}\right) \]
    9. Step-by-step derivation
      1. Applied rewrites93.3%

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

      if -5.5999999999999999e160 < z < 2.9e206

      1. Initial program 100.0%

        \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 4: 84.1% accurate, 1.0× speedup?

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

      1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(z \cdot \log \left(\frac{1}{t}\right) + \color{blue}{z \cdot 1}\right) + \left(b \cdot \left(a - \frac{1}{2}\right) + x\right) \]
        10. distribute-lft-inN/A

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(z, 1 + -1 \cdot \log t, b \cdot \left(a - \frac{1}{2}\right) + x\right)} \]
      5. Applied rewrites85.2%

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

      if 1.00000000000000003e170 < (+.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. +-commutativeN/A

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

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

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

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

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

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

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

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

    Alternative 5: 99.9% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + b \cdot \left(a - 0.5\right) \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (+ (- (+ (+ x y) z) (* z (log t))) (* b (- a 0.5))))
    double code(double x, double y, double z, double t, double a, double b) {
    	return (((x + y) + z) - (z * log(t))) + (b * (a - 0.5));
    }
    
    real(8) function code(x, y, z, t, a, b)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        code = (((x + y) + z) - (z * log(t))) + (b * (a - 0.5d0))
    end function
    
    public static double code(double x, double y, double z, double t, double a, double b) {
    	return (((x + y) + z) - (z * Math.log(t))) + (b * (a - 0.5));
    }
    
    def code(x, y, z, t, a, b):
    	return (((x + y) + z) - (z * math.log(t))) + (b * (a - 0.5))
    
    function code(x, y, z, t, a, b)
    	return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(b * Float64(a - 0.5)))
    end
    
    function tmp = code(x, y, z, t, a, b)
    	tmp = (((x + y) + z) - (z * log(t))) + (b * (a - 0.5));
    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[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + b \cdot \left(a - 0.5\right)
    \end{array}
    
    Derivation
    1. Initial program 99.9%

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

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

    Alternative 6: 85.7% accurate, 1.0× speedup?

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

      1. Initial program 99.6%

        \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(x + y\right) + \color{blue}{\left(z + \left(\mathsf{neg}\left(\log t\right)\right) \cdot z\right)} \]
        5. *-lft-identityN/A

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

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

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

          \[\leadsto \left(x + y\right) + z \cdot \left(1 + \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)}\right) \]
        9. sub-negN/A

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(z, 1 - \log t, x + y\right)} \]
        12. lower--.f64N/A

          \[\leadsto \mathsf{fma}\left(z, \color{blue}{1 - \log t}, x + y\right) \]
        13. lower-log.f64N/A

          \[\leadsto \mathsf{fma}\left(z, 1 - \color{blue}{\log t}, x + y\right) \]
        14. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
        15. lower-+.f6481.2

          \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
      7. Applied rewrites81.2%

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

        \[\leadsto x + \color{blue}{z \cdot \left(1 - \log t\right)} \]
      9. Step-by-step derivation
        1. Applied rewrites77.4%

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

        if -4.5000000000000003e166 < z < 1.2500000000000001e171

        1. Initial program 100.0%

          \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.2500000000000001e171 < z

        1. Initial program 99.5%

          \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(x + y\right) + \color{blue}{\left(z + \left(\mathsf{neg}\left(\log t\right)\right) \cdot z\right)} \]
          5. *-lft-identityN/A

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

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

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

            \[\leadsto \left(x + y\right) + z \cdot \left(1 + \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)}\right) \]
          9. sub-negN/A

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(z, 1 - \log t, x + y\right)} \]
          12. lower--.f64N/A

            \[\leadsto \mathsf{fma}\left(z, \color{blue}{1 - \log t}, x + y\right) \]
          13. lower-log.f64N/A

            \[\leadsto \mathsf{fma}\left(z, 1 - \color{blue}{\log t}, x + y\right) \]
          14. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
          15. lower-+.f6484.3

            \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
        7. Applied rewrites84.3%

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

          \[\leadsto y + \color{blue}{z \cdot \left(1 - \log t\right)} \]
        9. Step-by-step derivation
          1. Applied rewrites76.3%

            \[\leadsto \mathsf{fma}\left(z, \color{blue}{1 - \log t}, y\right) \]
        10. Recombined 3 regimes into one program.
        11. Final simplification88.7%

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

        Alternative 7: 85.2% accurate, 1.0× speedup?

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

          1. Initial program 99.6%

            \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(x + y\right) + \color{blue}{\left(z + \left(\mathsf{neg}\left(\log t\right)\right) \cdot z\right)} \]
            5. *-lft-identityN/A

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

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

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

              \[\leadsto \left(x + y\right) + z \cdot \left(1 + \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)}\right) \]
            9. sub-negN/A

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(z, 1 - \log t, x + y\right)} \]
            12. lower--.f64N/A

              \[\leadsto \mathsf{fma}\left(z, \color{blue}{1 - \log t}, x + y\right) \]
            13. lower-log.f64N/A

              \[\leadsto \mathsf{fma}\left(z, 1 - \color{blue}{\log t}, x + y\right) \]
            14. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
            15. lower-+.f6481.2

              \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
          7. Applied rewrites81.2%

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

            \[\leadsto x + \color{blue}{z \cdot \left(1 - \log t\right)} \]
          9. Step-by-step derivation
            1. Applied rewrites77.4%

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

            if -4.5000000000000003e166 < z < 4.9999999999999999e207

            1. Initial program 100.0%

              \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 4.9999999999999999e207 < z

            1. Initial program 99.4%

              \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto z \cdot \color{blue}{\left(\log \left(\frac{1}{t}\right) + 1\right)} \]
              4. distribute-rgt-inN/A

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

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)} \cdot z + 1 \cdot z \]
              6. distribute-lft-neg-inN/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\log t \cdot z\right)\right)} + 1 \cdot z \]
              7. distribute-rgt-neg-inN/A

                \[\leadsto \color{blue}{\log t \cdot \left(\mathsf{neg}\left(z\right)\right)} + 1 \cdot z \]
              8. neg-mul-1N/A

                \[\leadsto \log t \cdot \color{blue}{\left(-1 \cdot z\right)} + 1 \cdot z \]
              9. *-lft-identityN/A

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

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{\log t}, -1 \cdot z, z\right) \]
              12. neg-mul-1N/A

                \[\leadsto \mathsf{fma}\left(\log t, \color{blue}{\mathsf{neg}\left(z\right)}, z\right) \]
              13. lower-neg.f6473.6

                \[\leadsto \mathsf{fma}\left(\log t, \color{blue}{-z}, z\right) \]
            7. Applied rewrites73.6%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\log t, -z, z\right)} \]
          10. Recombined 3 regimes into one program.
          11. Final simplification88.3%

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

          Alternative 8: 84.4% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\log t, -z, z\right)\\ \mathbf{if}\;z \leq -4.8 \cdot 10^{+166}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+207}:\\ \;\;\;\;\mathsf{fma}\left(b, a, b \cdot -0.5\right) + \left(x + y\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t a b)
           :precision binary64
           (let* ((t_1 (fma (log t) (- z) z)))
             (if (<= z -4.8e+166)
               t_1
               (if (<= z 5e+207) (+ (fma b a (* b -0.5)) (+ x y)) t_1))))
          double code(double x, double y, double z, double t, double a, double b) {
          	double t_1 = fma(log(t), -z, z);
          	double tmp;
          	if (z <= -4.8e+166) {
          		tmp = t_1;
          	} else if (z <= 5e+207) {
          		tmp = fma(b, a, (b * -0.5)) + (x + y);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t, a, b)
          	t_1 = fma(log(t), Float64(-z), z)
          	tmp = 0.0
          	if (z <= -4.8e+166)
          		tmp = t_1;
          	elseif (z <= 5e+207)
          		tmp = Float64(fma(b, a, Float64(b * -0.5)) + Float64(x + y));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * (-z) + z), $MachinePrecision]}, If[LessEqual[z, -4.8e+166], t$95$1, If[LessEqual[z, 5e+207], N[(N[(b * a + N[(b * -0.5), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := \mathsf{fma}\left(\log t, -z, z\right)\\
          \mathbf{if}\;z \leq -4.8 \cdot 10^{+166}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;z \leq 5 \cdot 10^{+207}:\\
          \;\;\;\;\mathsf{fma}\left(b, a, b \cdot -0.5\right) + \left(x + y\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -4.79999999999999984e166 or 4.9999999999999999e207 < z

            1. Initial program 99.5%

              \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto z \cdot \color{blue}{\left(\log \left(\frac{1}{t}\right) + 1\right)} \]
              4. distribute-rgt-inN/A

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

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)} \cdot z + 1 \cdot z \]
              6. distribute-lft-neg-inN/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\log t \cdot z\right)\right)} + 1 \cdot z \]
              7. distribute-rgt-neg-inN/A

                \[\leadsto \color{blue}{\log t \cdot \left(\mathsf{neg}\left(z\right)\right)} + 1 \cdot z \]
              8. neg-mul-1N/A

                \[\leadsto \log t \cdot \color{blue}{\left(-1 \cdot z\right)} + 1 \cdot z \]
              9. *-lft-identityN/A

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

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{\log t}, -1 \cdot z, z\right) \]
              12. neg-mul-1N/A

                \[\leadsto \mathsf{fma}\left(\log t, \color{blue}{\mathsf{neg}\left(z\right)}, z\right) \]
              13. lower-neg.f6474.1

                \[\leadsto \mathsf{fma}\left(\log t, \color{blue}{-z}, z\right) \]
            7. Applied rewrites74.1%

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

            if -4.79999999999999984e166 < z < 4.9999999999999999e207

            1. Initial program 100.0%

              \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 9: 84.3% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := z - z \cdot \log t\\ \mathbf{if}\;z \leq -4.5 \cdot 10^{+162}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+207}:\\ \;\;\;\;\mathsf{fma}\left(b, a, b \cdot -0.5\right) + \left(x + y\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t a b)
           :precision binary64
           (let* ((t_1 (- z (* z (log t)))))
             (if (<= z -4.5e+162)
               t_1
               (if (<= z 5e+207) (+ (fma b a (* b -0.5)) (+ x y)) t_1))))
          double code(double x, double y, double z, double t, double a, double b) {
          	double t_1 = z - (z * log(t));
          	double tmp;
          	if (z <= -4.5e+162) {
          		tmp = t_1;
          	} else if (z <= 5e+207) {
          		tmp = fma(b, a, (b * -0.5)) + (x + y);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t, a, b)
          	t_1 = Float64(z - Float64(z * log(t)))
          	tmp = 0.0
          	if (z <= -4.5e+162)
          		tmp = t_1;
          	elseif (z <= 5e+207)
          		tmp = Float64(fma(b, a, Float64(b * -0.5)) + Float64(x + y));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+162], t$95$1, If[LessEqual[z, 5e+207], N[(N[(b * a + N[(b * -0.5), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := z - z \cdot \log t\\
          \mathbf{if}\;z \leq -4.5 \cdot 10^{+162}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;z \leq 5 \cdot 10^{+207}:\\
          \;\;\;\;\mathsf{fma}\left(b, a, b \cdot -0.5\right) + \left(x + y\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -4.49999999999999972e162 or 4.9999999999999999e207 < z

            1. Initial program 99.5%

              \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
            2. 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. sub-negN/A

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

                \[\leadsto z \cdot \left(1 + \color{blue}{\log \left(\frac{1}{t}\right)}\right) \]
              3. distribute-lft-inN/A

                \[\leadsto \color{blue}{z \cdot 1 + z \cdot \log \left(\frac{1}{t}\right)} \]
              4. *-rgt-identityN/A

                \[\leadsto \color{blue}{z} + z \cdot \log \left(\frac{1}{t}\right) \]
              5. remove-double-negN/A

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

                \[\leadsto z + \left(\mathsf{neg}\left(\color{blue}{-1 \cdot \left(z \cdot \log \left(\frac{1}{t}\right)\right)}\right)\right) \]
              7. sub-negN/A

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

                \[\leadsto \color{blue}{z - -1 \cdot \left(z \cdot \log \left(\frac{1}{t}\right)\right)} \]
              9. mul-1-negN/A

                \[\leadsto z - \color{blue}{\left(\mathsf{neg}\left(z \cdot \log \left(\frac{1}{t}\right)\right)\right)} \]
              10. distribute-rgt-neg-inN/A

                \[\leadsto z - \color{blue}{z \cdot \left(\mathsf{neg}\left(\log \left(\frac{1}{t}\right)\right)\right)} \]
              11. log-recN/A

                \[\leadsto z - z \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)}\right)\right) \]
              12. remove-double-negN/A

                \[\leadsto z - z \cdot \color{blue}{\log t} \]
              13. lower-*.f64N/A

                \[\leadsto z - \color{blue}{z \cdot \log t} \]
              14. lower-log.f6473.2

                \[\leadsto z - z \cdot \color{blue}{\log t} \]
            5. Applied rewrites73.2%

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

            if -4.49999999999999972e162 < z < 4.9999999999999999e207

            1. Initial program 100.0%

              \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 10: 57.2% accurate, 2.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+150}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+211}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+289}:\\ \;\;\;\;b \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;b \cdot a\\ \end{array} \end{array} \]
          (FPCore (x y z t a b)
           :precision binary64
           (let* ((t_1 (* b (- a 0.5))))
             (if (<= t_1 -5e+150)
               (* b a)
               (if (<= t_1 2e+211) (+ x y) (if (<= t_1 2e+289) (* b -0.5) (* b a))))))
          double code(double x, double y, double z, double t, double a, double b) {
          	double t_1 = b * (a - 0.5);
          	double tmp;
          	if (t_1 <= -5e+150) {
          		tmp = b * a;
          	} else if (t_1 <= 2e+211) {
          		tmp = x + y;
          	} else if (t_1 <= 2e+289) {
          		tmp = b * -0.5;
          	} else {
          		tmp = b * a;
          	}
          	return tmp;
          }
          
          real(8) function code(x, y, z, t, a, b)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              real(8), intent (in) :: a
              real(8), intent (in) :: b
              real(8) :: t_1
              real(8) :: tmp
              t_1 = b * (a - 0.5d0)
              if (t_1 <= (-5d+150)) then
                  tmp = b * a
              else if (t_1 <= 2d+211) then
                  tmp = x + y
              else if (t_1 <= 2d+289) then
                  tmp = b * (-0.5d0)
              else
                  tmp = b * a
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t, double a, double b) {
          	double t_1 = b * (a - 0.5);
          	double tmp;
          	if (t_1 <= -5e+150) {
          		tmp = b * a;
          	} else if (t_1 <= 2e+211) {
          		tmp = x + y;
          	} else if (t_1 <= 2e+289) {
          		tmp = b * -0.5;
          	} else {
          		tmp = b * a;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a, b):
          	t_1 = b * (a - 0.5)
          	tmp = 0
          	if t_1 <= -5e+150:
          		tmp = b * a
          	elif t_1 <= 2e+211:
          		tmp = x + y
          	elif t_1 <= 2e+289:
          		tmp = b * -0.5
          	else:
          		tmp = b * a
          	return tmp
          
          function code(x, y, z, t, a, b)
          	t_1 = Float64(b * Float64(a - 0.5))
          	tmp = 0.0
          	if (t_1 <= -5e+150)
          		tmp = Float64(b * a);
          	elseif (t_1 <= 2e+211)
          		tmp = Float64(x + y);
          	elseif (t_1 <= 2e+289)
          		tmp = Float64(b * -0.5);
          	else
          		tmp = Float64(b * a);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a, b)
          	t_1 = b * (a - 0.5);
          	tmp = 0.0;
          	if (t_1 <= -5e+150)
          		tmp = b * a;
          	elseif (t_1 <= 2e+211)
          		tmp = x + y;
          	elseif (t_1 <= 2e+289)
          		tmp = b * -0.5;
          	else
          		tmp = b * a;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+150], N[(b * a), $MachinePrecision], If[LessEqual[t$95$1, 2e+211], N[(x + y), $MachinePrecision], If[LessEqual[t$95$1, 2e+289], N[(b * -0.5), $MachinePrecision], N[(b * a), $MachinePrecision]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := b \cdot \left(a - 0.5\right)\\
          \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+150}:\\
          \;\;\;\;b \cdot a\\
          
          \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+211}:\\
          \;\;\;\;x + y\\
          
          \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+289}:\\
          \;\;\;\;b \cdot -0.5\\
          
          \mathbf{else}:\\
          \;\;\;\;b \cdot a\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -5.00000000000000009e150 or 2.0000000000000001e289 < (*.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-*.f6467.4

                \[\leadsto \color{blue}{b \cdot a} \]
            5. Applied rewrites67.4%

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

            if -5.00000000000000009e150 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.9999999999999999e211

            1. Initial program 99.8%

              \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(x + y\right) + \color{blue}{\left(z + \left(\mathsf{neg}\left(\log t\right)\right) \cdot z\right)} \]
              5. *-lft-identityN/A

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

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

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

                \[\leadsto \left(x + y\right) + z \cdot \left(1 + \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)}\right) \]
              9. sub-negN/A

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(z, 1 - \log t, x + y\right)} \]
              12. lower--.f64N/A

                \[\leadsto \mathsf{fma}\left(z, \color{blue}{1 - \log t}, x + y\right) \]
              13. lower-log.f64N/A

                \[\leadsto \mathsf{fma}\left(z, 1 - \color{blue}{\log t}, x + y\right) \]
              14. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
              15. lower-+.f6486.2

                \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
            7. Applied rewrites86.2%

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

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

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

              if 1.9999999999999999e211 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2.0000000000000001e289

              1. Initial program 99.9%

                \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto b \cdot \color{blue}{\left(a + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)} \]
                3. metadata-evalN/A

                  \[\leadsto b \cdot \left(a + \color{blue}{\frac{-1}{2}}\right) \]
                4. lower-+.f6464.2

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

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

                \[\leadsto b \cdot \frac{-1}{2} \]
              9. Step-by-step derivation
                1. Applied rewrites46.7%

                  \[\leadsto b \cdot -0.5 \]
              10. Recombined 3 regimes into one program.
              11. Final simplification59.2%

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

              Alternative 11: 64.7% accurate, 3.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+110}:\\ \;\;\;\;\mathsf{fma}\left(b, a, b \cdot -0.5\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+139}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a + -0.5\right)\\ \end{array} \end{array} \]
              (FPCore (x y z t a b)
               :precision binary64
               (let* ((t_1 (* b (- a 0.5))))
                 (if (<= t_1 -2e+110)
                   (fma b a (* b -0.5))
                   (if (<= t_1 1e+139) (+ x y) (* b (+ a -0.5))))))
              double code(double x, double y, double z, double t, double a, double b) {
              	double t_1 = b * (a - 0.5);
              	double tmp;
              	if (t_1 <= -2e+110) {
              		tmp = fma(b, a, (b * -0.5));
              	} else if (t_1 <= 1e+139) {
              		tmp = x + y;
              	} else {
              		tmp = b * (a + -0.5);
              	}
              	return tmp;
              }
              
              function code(x, y, z, t, a, b)
              	t_1 = Float64(b * Float64(a - 0.5))
              	tmp = 0.0
              	if (t_1 <= -2e+110)
              		tmp = fma(b, a, Float64(b * -0.5));
              	elseif (t_1 <= 1e+139)
              		tmp = Float64(x + y);
              	else
              		tmp = Float64(b * Float64(a + -0.5));
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+110], N[(b * a + N[(b * -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+139], N[(x + y), $MachinePrecision], N[(b * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := b \cdot \left(a - 0.5\right)\\
              \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+110}:\\
              \;\;\;\;\mathsf{fma}\left(b, a, b \cdot -0.5\right)\\
              
              \mathbf{elif}\;t\_1 \leq 10^{+139}:\\
              \;\;\;\;x + y\\
              
              \mathbf{else}:\\
              \;\;\;\;b \cdot \left(a + -0.5\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -2e110

                1. Initial program 99.9%

                  \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto b \cdot \color{blue}{\left(a + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)} \]
                  3. metadata-evalN/A

                    \[\leadsto b \cdot \left(a + \color{blue}{\frac{-1}{2}}\right) \]
                  4. lower-+.f6475.7

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

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

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

                  if -2e110 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.00000000000000003e139

                  1. Initial program 99.8%

                    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(x + y\right) + \color{blue}{\left(z + \left(\mathsf{neg}\left(\log t\right)\right) \cdot z\right)} \]
                    5. *-lft-identityN/A

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

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

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

                      \[\leadsto \left(x + y\right) + z \cdot \left(1 + \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)}\right) \]
                    9. sub-negN/A

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(z, 1 - \log t, x + y\right)} \]
                    12. lower--.f64N/A

                      \[\leadsto \mathsf{fma}\left(z, \color{blue}{1 - \log t}, x + y\right) \]
                    13. lower-log.f64N/A

                      \[\leadsto \mathsf{fma}\left(z, 1 - \color{blue}{\log t}, x + y\right) \]
                    14. +-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
                    15. lower-+.f6489.9

                      \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
                  7. Applied rewrites89.9%

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

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

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

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

                    1. Initial program 99.9%

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

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

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

                        \[\leadsto b \cdot \color{blue}{\left(a + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)} \]
                      3. metadata-evalN/A

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

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

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

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

                  Alternative 12: 64.7% accurate, 3.4× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ t_2 := b \cdot \left(a + -0.5\right)\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+110}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 10^{+139}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
                  (FPCore (x y z t a b)
                   :precision binary64
                   (let* ((t_1 (* b (- a 0.5))) (t_2 (* b (+ a -0.5))))
                     (if (<= t_1 -2e+110) t_2 (if (<= t_1 1e+139) (+ x y) t_2))))
                  double code(double x, double y, double z, double t, double a, double b) {
                  	double t_1 = b * (a - 0.5);
                  	double t_2 = b * (a + -0.5);
                  	double tmp;
                  	if (t_1 <= -2e+110) {
                  		tmp = t_2;
                  	} else if (t_1 <= 1e+139) {
                  		tmp = x + y;
                  	} else {
                  		tmp = t_2;
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(x, y, z, t, a, b)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8), intent (in) :: t
                      real(8), intent (in) :: a
                      real(8), intent (in) :: b
                      real(8) :: t_1
                      real(8) :: t_2
                      real(8) :: tmp
                      t_1 = b * (a - 0.5d0)
                      t_2 = b * (a + (-0.5d0))
                      if (t_1 <= (-2d+110)) then
                          tmp = t_2
                      else if (t_1 <= 1d+139) then
                          tmp = x + y
                      else
                          tmp = t_2
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t, double a, double b) {
                  	double t_1 = b * (a - 0.5);
                  	double t_2 = b * (a + -0.5);
                  	double tmp;
                  	if (t_1 <= -2e+110) {
                  		tmp = t_2;
                  	} else if (t_1 <= 1e+139) {
                  		tmp = x + y;
                  	} else {
                  		tmp = t_2;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t, a, b):
                  	t_1 = b * (a - 0.5)
                  	t_2 = b * (a + -0.5)
                  	tmp = 0
                  	if t_1 <= -2e+110:
                  		tmp = t_2
                  	elif t_1 <= 1e+139:
                  		tmp = x + y
                  	else:
                  		tmp = t_2
                  	return tmp
                  
                  function code(x, y, z, t, a, b)
                  	t_1 = Float64(b * Float64(a - 0.5))
                  	t_2 = Float64(b * Float64(a + -0.5))
                  	tmp = 0.0
                  	if (t_1 <= -2e+110)
                  		tmp = t_2;
                  	elseif (t_1 <= 1e+139)
                  		tmp = Float64(x + y);
                  	else
                  		tmp = t_2;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t, a, b)
                  	t_1 = b * (a - 0.5);
                  	t_2 = b * (a + -0.5);
                  	tmp = 0.0;
                  	if (t_1 <= -2e+110)
                  		tmp = t_2;
                  	elseif (t_1 <= 1e+139)
                  		tmp = x + y;
                  	else
                  		tmp = t_2;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+110], t$95$2, If[LessEqual[t$95$1, 1e+139], N[(x + y), $MachinePrecision], t$95$2]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_1 := b \cdot \left(a - 0.5\right)\\
                  t_2 := b \cdot \left(a + -0.5\right)\\
                  \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+110}:\\
                  \;\;\;\;t\_2\\
                  
                  \mathbf{elif}\;t\_1 \leq 10^{+139}:\\
                  \;\;\;\;x + y\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_2\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -2e110 or 1.00000000000000003e139 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)

                    1. Initial program 99.9%

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

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

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

                        \[\leadsto b \cdot \color{blue}{\left(a + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)} \]
                      3. metadata-evalN/A

                        \[\leadsto b \cdot \left(a + \color{blue}{\frac{-1}{2}}\right) \]
                      4. lower-+.f6473.8

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

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

                    if -2e110 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.00000000000000003e139

                    1. Initial program 99.8%

                      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
                    2. Add Preprocessing
                    3. Step-by-step derivation
                      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \left(x + y\right) + \color{blue}{\left(z + \left(\mathsf{neg}\left(\log t\right)\right) \cdot z\right)} \]
                      5. *-lft-identityN/A

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

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

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

                        \[\leadsto \left(x + y\right) + z \cdot \left(1 + \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)}\right) \]
                      9. sub-negN/A

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

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

                        \[\leadsto \color{blue}{\mathsf{fma}\left(z, 1 - \log t, x + y\right)} \]
                      12. lower--.f64N/A

                        \[\leadsto \mathsf{fma}\left(z, \color{blue}{1 - \log t}, x + y\right) \]
                      13. lower-log.f64N/A

                        \[\leadsto \mathsf{fma}\left(z, 1 - \color{blue}{\log t}, x + y\right) \]
                      14. +-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
                      15. lower-+.f6489.9

                        \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
                    7. Applied rewrites89.9%

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

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

                        \[\leadsto x + \color{blue}{y} \]
                    10. Recombined 2 regimes into one program.
                    11. Final simplification65.9%

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

                    Alternative 13: 57.3% accurate, 3.7× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+150}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+186}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;b \cdot a\\ \end{array} \end{array} \]
                    (FPCore (x y z t a b)
                     :precision binary64
                     (let* ((t_1 (* b (- a 0.5))))
                       (if (<= t_1 -5e+150) (* b a) (if (<= t_1 4e+186) (+ x y) (* b a)))))
                    double code(double x, double y, double z, double t, double a, double b) {
                    	double t_1 = b * (a - 0.5);
                    	double tmp;
                    	if (t_1 <= -5e+150) {
                    		tmp = b * a;
                    	} else if (t_1 <= 4e+186) {
                    		tmp = x + y;
                    	} else {
                    		tmp = b * a;
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(x, y, z, t, a, b)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        real(8), intent (in) :: t
                        real(8), intent (in) :: a
                        real(8), intent (in) :: b
                        real(8) :: t_1
                        real(8) :: tmp
                        t_1 = b * (a - 0.5d0)
                        if (t_1 <= (-5d+150)) then
                            tmp = b * a
                        else if (t_1 <= 4d+186) then
                            tmp = x + y
                        else
                            tmp = b * a
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y, double z, double t, double a, double b) {
                    	double t_1 = b * (a - 0.5);
                    	double tmp;
                    	if (t_1 <= -5e+150) {
                    		tmp = b * a;
                    	} else if (t_1 <= 4e+186) {
                    		tmp = x + y;
                    	} else {
                    		tmp = b * a;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z, t, a, b):
                    	t_1 = b * (a - 0.5)
                    	tmp = 0
                    	if t_1 <= -5e+150:
                    		tmp = b * a
                    	elif t_1 <= 4e+186:
                    		tmp = x + y
                    	else:
                    		tmp = b * a
                    	return tmp
                    
                    function code(x, y, z, t, a, b)
                    	t_1 = Float64(b * Float64(a - 0.5))
                    	tmp = 0.0
                    	if (t_1 <= -5e+150)
                    		tmp = Float64(b * a);
                    	elseif (t_1 <= 4e+186)
                    		tmp = Float64(x + y);
                    	else
                    		tmp = Float64(b * a);
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z, t, a, b)
                    	t_1 = b * (a - 0.5);
                    	tmp = 0.0;
                    	if (t_1 <= -5e+150)
                    		tmp = b * a;
                    	elseif (t_1 <= 4e+186)
                    		tmp = x + y;
                    	else
                    		tmp = b * a;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+150], N[(b * a), $MachinePrecision], If[LessEqual[t$95$1, 4e+186], N[(x + y), $MachinePrecision], N[(b * a), $MachinePrecision]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := b \cdot \left(a - 0.5\right)\\
                    \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+150}:\\
                    \;\;\;\;b \cdot a\\
                    
                    \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+186}:\\
                    \;\;\;\;x + y\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;b \cdot a\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -5.00000000000000009e150 or 3.99999999999999992e186 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)

                      1. Initial program 99.9%

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

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

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

                          \[\leadsto \color{blue}{b \cdot a} \]
                      5. Applied rewrites56.2%

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

                      if -5.00000000000000009e150 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 3.99999999999999992e186

                      1. Initial program 99.8%

                        \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
                      2. Add Preprocessing
                      3. Step-by-step derivation
                        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left(x + y\right) + \color{blue}{\left(z + \left(\mathsf{neg}\left(\log t\right)\right) \cdot z\right)} \]
                        5. *-lft-identityN/A

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

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

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

                          \[\leadsto \left(x + y\right) + z \cdot \left(1 + \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)}\right) \]
                        9. sub-negN/A

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

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

                          \[\leadsto \color{blue}{\mathsf{fma}\left(z, 1 - \log t, x + y\right)} \]
                        12. lower--.f64N/A

                          \[\leadsto \mathsf{fma}\left(z, \color{blue}{1 - \log t}, x + y\right) \]
                        13. lower-log.f64N/A

                          \[\leadsto \mathsf{fma}\left(z, 1 - \color{blue}{\log t}, x + y\right) \]
                        14. +-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
                        15. lower-+.f6487.1

                          \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
                      7. Applied rewrites87.1%

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

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

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

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

                      Alternative 14: 78.3% accurate, 7.0× speedup?

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

                        \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
                      2. Add Preprocessing
                      3. Step-by-step derivation
                        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 15: 78.3% accurate, 9.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 16: 42.3% accurate, 31.5× speedup?

                      \[\begin{array}{l} \\ x + y \end{array} \]
                      (FPCore (x y z t a b) :precision binary64 (+ x y))
                      double code(double x, double y, double z, double t, double a, double b) {
                      	return x + y;
                      }
                      
                      real(8) function code(x, y, z, t, a, b)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          real(8), intent (in) :: z
                          real(8), intent (in) :: t
                          real(8), intent (in) :: a
                          real(8), intent (in) :: b
                          code = x + y
                      end function
                      
                      public static double code(double x, double y, double z, double t, double a, double b) {
                      	return x + y;
                      }
                      
                      def code(x, y, z, t, a, b):
                      	return x + y
                      
                      function code(x, y, z, t, a, b)
                      	return Float64(x + y)
                      end
                      
                      function tmp = code(x, y, z, t, a, b)
                      	tmp = x + y;
                      end
                      
                      code[x_, y_, z_, t_, a_, b_] := N[(x + y), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      x + 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. Step-by-step derivation
                        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left(x + y\right) + \color{blue}{\left(z + \left(\mathsf{neg}\left(\log t\right)\right) \cdot z\right)} \]
                        5. *-lft-identityN/A

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

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

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

                          \[\leadsto \left(x + y\right) + z \cdot \left(1 + \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)}\right) \]
                        9. sub-negN/A

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

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

                          \[\leadsto \color{blue}{\mathsf{fma}\left(z, 1 - \log t, x + y\right)} \]
                        12. lower--.f64N/A

                          \[\leadsto \mathsf{fma}\left(z, \color{blue}{1 - \log t}, x + y\right) \]
                        13. lower-log.f64N/A

                          \[\leadsto \mathsf{fma}\left(z, 1 - \color{blue}{\log t}, x + y\right) \]
                        14. +-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
                        15. lower-+.f6461.9

                          \[\leadsto \mathsf{fma}\left(z, 1 - \log t, \color{blue}{y + x}\right) \]
                      7. Applied rewrites61.9%

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

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

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

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

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

                        Reproduce

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