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

Percentage Accurate: 99.9% → 99.9%
Time: 11.3s
Alternatives: 15
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 15 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} \\ \mathsf{fma}\left(a - 0.5, b, \mathsf{fma}\left(-z, \log t, \left(x + y\right) + z\right)\right) \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (fma (- a 0.5) b (fma (- z) (log t) (+ (+ x y) z))))
double code(double x, double y, double z, double t, double a, double b) {
	return fma((a - 0.5), b, fma(-z, log(t), ((x + y) + z)));
}
function code(x, y, z, t, a, b)
	return fma(Float64(a - 0.5), b, fma(Float64(-z), log(t), Float64(Float64(x + y) + z)))
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(a - 0.5), $MachinePrecision] * b + N[((-z) * N[Log[t], $MachinePrecision] + N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(a - 0.5, b, \mathsf{fma}\left(-z, \log t, \left(x + y\right) + z\right)\right)
\end{array}
Derivation
  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 \color{blue}{\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\right) \cdot b} \]
    2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+104}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, x + y\right)\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+35}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, b, \mathsf{fma}\left(1 - \log t, z, y\right)\right) + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (- a 0.5))))
   (if (<= t_1 -2e+104)
     (fma (- a 0.5) b (+ x y))
     (if (<= t_1 4e+35)
       (+ (fma -0.5 b (fma (- 1.0 (log t)) z y)) x)
       (+ (fma (- a 0.5) b y) 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 <= -2e+104) {
		tmp = fma((a - 0.5), b, (x + y));
	} else if (t_1 <= 4e+35) {
		tmp = fma(-0.5, b, fma((1.0 - log(t)), z, y)) + x;
	} else {
		tmp = fma((a - 0.5), b, y) + 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 <= -2e+104)
		tmp = fma(Float64(a - 0.5), b, Float64(x + y));
	elseif (t_1 <= 4e+35)
		tmp = Float64(fma(-0.5, b, fma(Float64(1.0 - log(t)), z, y)) + x);
	else
		tmp = Float64(fma(Float64(a - 0.5), b, y) + 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, -2e+104], N[(N[(a - 0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+35], N[(N[(-0.5 * b + N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}

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

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

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


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

    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 \color{blue}{\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\right) \cdot b} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e104 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 3.9999999999999999e35

    1. Initial program 99.8%

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

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

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

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

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

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

    if 3.9999999999999999e35 < (*.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. lower-+.f64N/A

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

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

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

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

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

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

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

Alternative 3: 89.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+104}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, x + y\right)\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+35}:\\ \;\;\;\;\mathsf{fma}\left(1 - \log t, z, y\right) + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (- a 0.5))))
   (if (<= t_1 -2e+104)
     (fma (- a 0.5) b (+ x y))
     (if (<= t_1 4e+35)
       (+ (fma (- 1.0 (log t)) z y) x)
       (+ (fma (- a 0.5) b y) 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 <= -2e+104) {
		tmp = fma((a - 0.5), b, (x + y));
	} else if (t_1 <= 4e+35) {
		tmp = fma((1.0 - log(t)), z, y) + x;
	} else {
		tmp = fma((a - 0.5), b, y) + 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 <= -2e+104)
		tmp = fma(Float64(a - 0.5), b, Float64(x + y));
	elseif (t_1 <= 4e+35)
		tmp = Float64(fma(Float64(1.0 - log(t)), z, y) + x);
	else
		tmp = Float64(fma(Float64(a - 0.5), b, y) + 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, -2e+104], N[(N[(a - 0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+35], N[(N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + y), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}

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

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

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


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

    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 \color{blue}{\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\right) \cdot b} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e104 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 3.9999999999999999e35

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{a \cdot b} \]
    4. Step-by-step derivation
      1. lower-*.f644.8

        \[\leadsto \color{blue}{a \cdot b} \]
    5. Applied rewrites4.8%

      \[\leadsto \color{blue}{a \cdot b} \]
    6. Taylor expanded in b around 0

      \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
    7. 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-+r-N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999999e35 < (*.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. lower-+.f64N/A

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

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

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

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

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

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

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

Alternative 4: 85.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.25 \cdot 10^{+99}:\\
\;\;\;\;\mathsf{fma}\left(1 - \log t, z, \mathsf{fma}\left(a - 0.5, b, x\right)\right)\\

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


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

    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. *-commutativeN/A

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

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

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

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

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

    if 1.25000000000000002e99 < y

    1. Initial program 100.0%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in 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. lower-+.f64N/A

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

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

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

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

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

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

Alternative 5: 86.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 1 - \log t\\ \mathbf{if}\;z \leq -3.2 \cdot 10^{+159}:\\ \;\;\;\;\mathsf{fma}\left(t\_1, z, y\right)\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+177}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, x + y\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_1, z, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (- 1.0 (log t))))
   (if (<= z -3.2e+159)
     (fma t_1 z y)
     (if (<= z 6.2e+177) (fma (- a 0.5) b (+ x y)) (fma t_1 z x)))))
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 <= -3.2e+159) {
		tmp = fma(t_1, z, y);
	} else if (z <= 6.2e+177) {
		tmp = fma((a - 0.5), b, (x + y));
	} else {
		tmp = fma(t_1, z, x);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(1.0 - log(t))
	tmp = 0.0
	if (z <= -3.2e+159)
		tmp = fma(t_1, z, y);
	elseif (z <= 6.2e+177)
		tmp = fma(Float64(a - 0.5), b, Float64(x + y));
	else
		tmp = fma(t_1, z, x);
	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, -3.2e+159], N[(t$95$1 * z + y), $MachinePrecision], If[LessEqual[z, 6.2e+177], N[(N[(a - 0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * z + x), $MachinePrecision]]]]
\begin{array}{l}

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, z, x\right)\\


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

    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. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot b} \]
    4. Step-by-step derivation
      1. lower-*.f6417.5

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

      \[\leadsto \color{blue}{a \cdot b} \]
    6. Taylor expanded in b around 0

      \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
    7. 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-+r-N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -3.19999999999999985e159 < z < 6.1999999999999998e177

      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 \color{blue}{\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\right) \cdot b} \]
        2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 6.1999999999999998e177 < 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 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. *-commutativeN/A

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(1 - \log t, \color{blue}{z}, x\right) \]
      8. Recombined 3 regimes into one program.
      9. Final simplification86.1%

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

      Alternative 6: 85.9% accurate, 1.0× speedup?

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

        1. Initial program 99.6%

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

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

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

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

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

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

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

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

          if -1.14999999999999998e159 < z < 6.1999999999999998e177

          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 \color{blue}{\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\right) \cdot b} \]
            2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 7: 84.1% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(-\log t, z, z\right)\\ \mathbf{if}\;z \leq -9.8 \cdot 10^{+160}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 8 \cdot 10^{+178}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, 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 -9.8e+160) t_1 (if (<= z 8e+178) (fma (- a 0.5) b (+ 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 <= -9.8e+160) {
        		tmp = t_1;
        	} else if (z <= 8e+178) {
        		tmp = fma((a - 0.5), b, (x + y));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t, a, b)
        	t_1 = fma(Float64(-log(t)), z, z)
        	tmp = 0.0
        	if (z <= -9.8e+160)
        		tmp = t_1;
        	elseif (z <= 8e+178)
        		tmp = fma(Float64(a - 0.5), b, 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, -9.8e+160], t$95$1, If[LessEqual[z, 8e+178], N[(N[(a - 0.5), $MachinePrecision] * b + 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 -9.8 \cdot 10^{+160}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;z \leq 8 \cdot 10^{+178}:\\
        \;\;\;\;\mathsf{fma}\left(a - 0.5, b, x + y\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -9.8000000000000005e160 or 8.0000000000000004e178 < z

          1. Initial program 99.6%

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

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

              \[\leadsto z - \color{blue}{\log t \cdot z} \]
            15. lower-log.f6468.5

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

            \[\leadsto \color{blue}{z - \log t \cdot z} \]
          6. Step-by-step derivation
            1. Applied rewrites68.7%

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

            if -9.8000000000000005e160 < z < 8.0000000000000004e178

            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 \color{blue}{\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\right) \cdot b} \]
              2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 8: 84.1% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := z - \log t \cdot z\\ \mathbf{if}\;z \leq -9.8 \cdot 10^{+160}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+178}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, x + y\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t a b)
           :precision binary64
           (let* ((t_1 (- z (* (log t) z))))
             (if (<= z -9.8e+160)
               t_1
               (if (<= z 8.5e+178) (fma (- a 0.5) b (+ x y)) t_1))))
          double code(double x, double y, double z, double t, double a, double b) {
          	double t_1 = z - (log(t) * z);
          	double tmp;
          	if (z <= -9.8e+160) {
          		tmp = t_1;
          	} else if (z <= 8.5e+178) {
          		tmp = fma((a - 0.5), b, (x + y));
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t, a, b)
          	t_1 = Float64(z - Float64(log(t) * z))
          	tmp = 0.0
          	if (z <= -9.8e+160)
          		tmp = t_1;
          	elseif (z <= 8.5e+178)
          		tmp = fma(Float64(a - 0.5), b, 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[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.8e+160], t$95$1, If[LessEqual[z, 8.5e+178], N[(N[(a - 0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := z - \log t \cdot z\\
          \mathbf{if}\;z \leq -9.8 \cdot 10^{+160}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;z \leq 8.5 \cdot 10^{+178}:\\
          \;\;\;\;\mathsf{fma}\left(a - 0.5, b, x + y\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -9.8000000000000005e160 or 8.49999999999999991e178 < z

            1. Initial program 99.6%

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

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

                \[\leadsto z - \color{blue}{\log t \cdot z} \]
              15. lower-log.f6468.5

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

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

            if -9.8000000000000005e160 < z < 8.49999999999999991e178

            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 \color{blue}{\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\right) \cdot b} \]
              2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 9: 58.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^{+188}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;t\_1 \leq 10^{+238}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+303}:\\ \;\;\;\;-0.5 \cdot b\\ \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+188)
               (* b a)
               (if (<= t_1 1e+238) (+ x y) (if (<= t_1 2e+303) (* -0.5 b) (* 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+188) {
          		tmp = b * a;
          	} else if (t_1 <= 1e+238) {
          		tmp = x + y;
          	} else if (t_1 <= 2e+303) {
          		tmp = -0.5 * b;
          	} 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+188)) then
                  tmp = b * a
              else if (t_1 <= 1d+238) then
                  tmp = x + y
              else if (t_1 <= 2d+303) then
                  tmp = (-0.5d0) * b
              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+188) {
          		tmp = b * a;
          	} else if (t_1 <= 1e+238) {
          		tmp = x + y;
          	} else if (t_1 <= 2e+303) {
          		tmp = -0.5 * b;
          	} 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+188:
          		tmp = b * a
          	elif t_1 <= 1e+238:
          		tmp = x + y
          	elif t_1 <= 2e+303:
          		tmp = -0.5 * b
          	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+188)
          		tmp = Float64(b * a);
          	elseif (t_1 <= 1e+238)
          		tmp = Float64(x + y);
          	elseif (t_1 <= 2e+303)
          		tmp = Float64(-0.5 * b);
          	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+188)
          		tmp = b * a;
          	elseif (t_1 <= 1e+238)
          		tmp = x + y;
          	elseif (t_1 <= 2e+303)
          		tmp = -0.5 * b;
          	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+188], N[(b * a), $MachinePrecision], If[LessEqual[t$95$1, 1e+238], N[(x + y), $MachinePrecision], If[LessEqual[t$95$1, 2e+303], N[(-0.5 * b), $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^{+188}:\\
          \;\;\;\;b \cdot a\\
          
          \mathbf{elif}\;t\_1 \leq 10^{+238}:\\
          \;\;\;\;x + y\\
          
          \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+303}:\\
          \;\;\;\;-0.5 \cdot b\\
          
          \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.0000000000000001e188 or 2e303 < (*.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. lower-*.f6477.6

                \[\leadsto \color{blue}{a \cdot b} \]
            5. Applied rewrites77.6%

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

            if -5.0000000000000001e188 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1e238

            1. Initial program 99.8%

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

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

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

              \[\leadsto \color{blue}{a \cdot b} \]
            6. Taylor expanded in b around 0

              \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
            7. 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-+r-N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\left(y + z \cdot \left(1 - \log t\right)\right) + x} \]
            8. Applied rewrites85.3%

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

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

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

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

              1. Initial program 99.8%

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

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

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

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

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

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

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

                  \[\leadsto -0.5 \cdot b \]
              8. Recombined 3 regimes into one program.
              9. Final simplification63.0%

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

              Alternative 10: 68.7% accurate, 3.3× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ t_2 := \mathsf{fma}\left(a - 0.5, b, x\right)\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+104}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 10^{-24}:\\ \;\;\;\;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 (fma (- a 0.5) b x)))
                 (if (<= t_1 -2e+104) t_2 (if (<= t_1 1e-24) (+ 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 = fma((a - 0.5), b, x);
              	double tmp;
              	if (t_1 <= -2e+104) {
              		tmp = t_2;
              	} else if (t_1 <= 1e-24) {
              		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 = fma(Float64(a - 0.5), b, x)
              	tmp = 0.0
              	if (t_1 <= -2e+104)
              		tmp = t_2;
              	elseif (t_1 <= 1e-24)
              		tmp = Float64(x + y);
              	else
              		tmp = t_2;
              	end
              	return 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[(N[(a - 0.5), $MachinePrecision] * b + x), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+104], t$95$2, If[LessEqual[t$95$1, 1e-24], N[(x + y), $MachinePrecision], t$95$2]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := b \cdot \left(a - 0.5\right)\\
              t_2 := \mathsf{fma}\left(a - 0.5, b, x\right)\\
              \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+104}:\\
              \;\;\;\;t\_2\\
              
              \mathbf{elif}\;t\_1 \leq 10^{-24}:\\
              \;\;\;\;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) < -2e104 or 9.99999999999999924e-25 < (*.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 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. *-commutativeN/A

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

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

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

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

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

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

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

                  if -2e104 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 9.99999999999999924e-25

                  1. Initial program 99.8%

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

                    \[\leadsto \color{blue}{a \cdot b} \]
                  4. Step-by-step derivation
                    1. lower-*.f643.9

                      \[\leadsto \color{blue}{a \cdot b} \]
                  5. Applied rewrites3.9%

                    \[\leadsto \color{blue}{a \cdot b} \]
                  6. Taylor expanded in b around 0

                    \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
                  7. 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-+r-N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\left(y + z \cdot \left(1 - \log t\right)\right) + x} \]
                  8. Applied rewrites96.7%

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

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

                      \[\leadsto y + \color{blue}{x} \]
                  11. Recombined 2 regimes into one program.
                  12. Final simplification70.0%

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

                  Alternative 11: 64.5% accurate, 3.4× speedup?

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

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

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

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

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

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

                    1. Initial program 99.8%

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

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

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

                      \[\leadsto \color{blue}{a \cdot b} \]
                    6. Taylor expanded in b around 0

                      \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
                    7. 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-+r-N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 12: 57.9% 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^{+188}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+241}:\\ \;\;\;\;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+188) (* b a) (if (<= t_1 5e+241) (+ 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+188) {
                    		tmp = b * a;
                    	} else if (t_1 <= 5e+241) {
                    		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+188)) then
                            tmp = b * a
                        else if (t_1 <= 5d+241) 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+188) {
                    		tmp = b * a;
                    	} else if (t_1 <= 5e+241) {
                    		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+188:
                    		tmp = b * a
                    	elif t_1 <= 5e+241:
                    		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+188)
                    		tmp = Float64(b * a);
                    	elseif (t_1 <= 5e+241)
                    		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+188)
                    		tmp = b * a;
                    	elseif (t_1 <= 5e+241)
                    		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+188], N[(b * a), $MachinePrecision], If[LessEqual[t$95$1, 5e+241], 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^{+188}:\\
                    \;\;\;\;b \cdot a\\
                    
                    \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+241}:\\
                    \;\;\;\;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.0000000000000001e188 or 5.00000000000000025e241 < (*.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. lower-*.f6471.0

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

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

                      if -5.0000000000000001e188 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 5.00000000000000025e241

                      1. Initial program 99.8%

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

                        \[\leadsto \color{blue}{a \cdot b} \]
                      4. Step-by-step derivation
                        1. lower-*.f6411.3

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

                        \[\leadsto \color{blue}{a \cdot b} \]
                      6. Taylor expanded in b around 0

                        \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
                      7. 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-+r-N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto y + \color{blue}{x} \]
                      11. Recombined 2 regimes into one program.
                      12. Final simplification61.0%

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

                      Alternative 13: 78.9% accurate, 9.7× speedup?

                      \[\begin{array}{l} \\ \mathsf{fma}\left(a - 0.5, b, x + y\right) \end{array} \]
                      (FPCore (x y z t a b) :precision binary64 (fma (- a 0.5) b (+ x y)))
                      double code(double x, double y, double z, double t, double a, double b) {
                      	return fma((a - 0.5), b, (x + y));
                      }
                      
                      function code(x, y, z, t, a, b)
                      	return fma(Float64(a - 0.5), b, Float64(x + y))
                      end
                      
                      code[x_, y_, z_, t_, a_, b_] := N[(N[(a - 0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      \mathsf{fma}\left(a - 0.5, b, x + y\right)
                      \end{array}
                      
                      Derivation
                      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 \color{blue}{\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\right) \cdot b} \]
                        2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 14: 78.9% accurate, 9.7× speedup?

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

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

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

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

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

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

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

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

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

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

                      Alternative 15: 42.0% 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.8%

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

                        \[\leadsto \color{blue}{a \cdot b} \]
                      4. Step-by-step derivation
                        1. lower-*.f6429.0

                          \[\leadsto \color{blue}{a \cdot b} \]
                      5. Applied rewrites29.0%

                        \[\leadsto \color{blue}{a \cdot b} \]
                      6. Taylor expanded in b around 0

                        \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
                      7. 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-+r-N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto y + \color{blue}{x} \]
                        2. Final simplification41.3%

                          \[\leadsto x + y \]
                        3. Add Preprocessing

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

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

                        Reproduce

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