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

Percentage Accurate: 99.8% → 99.8%
Time: 8.8s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 93.2% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+155}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, b, x\right) + \mathsf{fma}\left(t\_2, z, y\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, z, \mathsf{fma}\left(a - 0.5, b, y\right)\right)\\


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000017e169 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 4.9999999999999999e155

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999999e155 < (*.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 x around 0

      \[\leadsto \color{blue}{\left(y + \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(y + \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(y + \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(y + \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(y + \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(y + \left(z + b \cdot \left(a - \frac{1}{2}\right)\right)\right)} \]
      6. associate-+r+N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(1 - \log t, z, \mathsf{fma}\left(a - 0.5, b, y\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.1%

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

Alternative 3: 93.2% accurate, 0.9× 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, y + x\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+169}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 10^{+112}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, b, x\right) + \mathsf{fma}\left(1 - \log t, z, y\right)\\ \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 (+ y x))))
   (if (<= t_1 -5e+169)
     t_2
     (if (<= t_1 1e+112) (+ (fma -0.5 b x) (fma (- 1.0 (log t)) z 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, (y + x));
	double tmp;
	if (t_1 <= -5e+169) {
		tmp = t_2;
	} else if (t_1 <= 1e+112) {
		tmp = fma(-0.5, b, x) + fma((1.0 - log(t)), z, 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, Float64(y + x))
	tmp = 0.0
	if (t_1 <= -5e+169)
		tmp = t_2;
	elseif (t_1 <= 1e+112)
		tmp = Float64(fma(-0.5, b, x) + fma(Float64(1.0 - log(t)), z, 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 + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+169], t$95$2, If[LessEqual[t$95$1, 1e+112], N[(N[(-0.5 * b + x), $MachinePrecision] + N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + y), $MachinePrecision]), $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, y + x\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+169}:\\
\;\;\;\;t\_2\\

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

\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) < -5.00000000000000017e169 or 9.9999999999999993e111 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000017e169 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 9.9999999999999993e111

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 89.5% accurate, 0.9× 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, y + x\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+169}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 10^{+112}:\\ \;\;\;\;\mathsf{fma}\left(1 - \log t, z, y\right) + x\\ \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 (+ y x))))
   (if (<= t_1 -5e+169)
     t_2
     (if (<= t_1 1e+112) (+ (fma (- 1.0 (log t)) z y) x) 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, (y + x));
	double tmp;
	if (t_1 <= -5e+169) {
		tmp = t_2;
	} else if (t_1 <= 1e+112) {
		tmp = fma((1.0 - log(t)), z, y) + x;
	} 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, Float64(y + x))
	tmp = 0.0
	if (t_1 <= -5e+169)
		tmp = t_2;
	elseif (t_1 <= 1e+112)
		tmp = Float64(fma(Float64(1.0 - log(t)), z, y) + x);
	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 + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+169], t$95$2, If[LessEqual[t$95$1, 1e+112], N[(N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + y), $MachinePrecision] + x), $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, y + x\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+169}:\\
\;\;\;\;t\_2\\

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

\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) < -5.00000000000000017e169 or 9.9999999999999993e111 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000017e169 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 9.9999999999999993e111

    1. Initial program 99.8%

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

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

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

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

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

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

    Alternative 5: 86.4% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(1 - \log t, z, y\right)\\ \mathbf{if}\;z \leq -5.9 \cdot 10^{+190}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{+167}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y + x\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 y)))
       (if (<= z -5.9e+190)
         t_1
         (if (<= z 6.5e+167) (fma (- a 0.5) b (+ y x)) 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, y);
    	double tmp;
    	if (z <= -5.9e+190) {
    		tmp = t_1;
    	} else if (z <= 6.5e+167) {
    		tmp = fma((a - 0.5), b, (y + x));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	t_1 = fma(Float64(1.0 - log(t)), z, y)
    	tmp = 0.0
    	if (z <= -5.9e+190)
    		tmp = t_1;
    	elseif (z <= 6.5e+167)
    		tmp = fma(Float64(a - 0.5), b, Float64(y + x));
    	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 + y), $MachinePrecision]}, If[LessEqual[z, -5.9e+190], t$95$1, If[LessEqual[z, 6.5e+167], N[(N[(a - 0.5), $MachinePrecision] * b + N[(y + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \mathsf{fma}\left(1 - \log t, z, y\right)\\
    \mathbf{if}\;z \leq -5.9 \cdot 10^{+190}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 6.5 \cdot 10^{+167}:\\
    \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y + x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -5.89999999999999972e190 or 6.5e167 < 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 x around 0

        \[\leadsto \color{blue}{\left(y + \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(y + \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(y + \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(y + \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(y + \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(y + \left(z + b \cdot \left(a - \frac{1}{2}\right)\right)\right)} \]
        6. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

        if -5.89999999999999972e190 < z < 6.5e167

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

      Alternative 6: 85.0% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(-\log t, z, z\right)\\ \mathbf{if}\;z \leq -6 \cdot 10^{+191}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+167}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y + x\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 -6e+191) t_1 (if (<= z 7.2e+167) (fma (- a 0.5) b (+ y x)) 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 <= -6e+191) {
      		tmp = t_1;
      	} else if (z <= 7.2e+167) {
      		tmp = fma((a - 0.5), b, (y + x));
      	} 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 <= -6e+191)
      		tmp = t_1;
      	elseif (z <= 7.2e+167)
      		tmp = fma(Float64(a - 0.5), b, Float64(y + x));
      	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, -6e+191], t$95$1, If[LessEqual[z, 7.2e+167], N[(N[(a - 0.5), $MachinePrecision] * b + N[(y + x), $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 -6 \cdot 10^{+191}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 7.2 \cdot 10^{+167}:\\
      \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y + x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -5.9999999999999995e191 or 7.20000000000000049e167 < 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. distribute-lft-out--N/A

            \[\leadsto \color{blue}{z \cdot 1 - z \cdot \log t} \]
          2. *-rgt-identityN/A

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

            \[\leadsto \color{blue}{z - z \cdot \log t} \]
          4. *-commutativeN/A

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

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

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

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

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

          if -5.9999999999999995e191 < z < 7.20000000000000049e167

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

        Alternative 7: 85.0% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := z - \log t \cdot z\\ \mathbf{if}\;z \leq -6 \cdot 10^{+191}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+167}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y + x\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 -6e+191) t_1 (if (<= z 7.2e+167) (fma (- a 0.5) b (+ y x)) 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 <= -6e+191) {
        		tmp = t_1;
        	} else if (z <= 7.2e+167) {
        		tmp = fma((a - 0.5), b, (y + x));
        	} 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 <= -6e+191)
        		tmp = t_1;
        	elseif (z <= 7.2e+167)
        		tmp = fma(Float64(a - 0.5), b, Float64(y + x));
        	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, -6e+191], t$95$1, If[LessEqual[z, 7.2e+167], N[(N[(a - 0.5), $MachinePrecision] * b + N[(y + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := z - \log t \cdot z\\
        \mathbf{if}\;z \leq -6 \cdot 10^{+191}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;z \leq 7.2 \cdot 10^{+167}:\\
        \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y + x\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -5.9999999999999995e191 or 7.20000000000000049e167 < 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. distribute-lft-out--N/A

              \[\leadsto \color{blue}{z \cdot 1 - z \cdot \log t} \]
            2. *-rgt-identityN/A

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

              \[\leadsto \color{blue}{z - z \cdot \log t} \]
            4. *-commutativeN/A

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

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

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

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

          if -5.9999999999999995e191 < z < 7.20000000000000049e167

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

        Alternative 8: 37.9% accurate, 5.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a - 0.5 \leq -100000000000:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;a - 0.5 \leq -0.4:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{else}:\\ \;\;\;\;b \cdot a\\ \end{array} \end{array} \]
        (FPCore (x y z t a b)
         :precision binary64
         (if (<= (- a 0.5) -100000000000.0)
           (* b a)
           (if (<= (- a 0.5) -0.4) (* -0.5 b) (* b a))))
        double code(double x, double y, double z, double t, double a, double b) {
        	double tmp;
        	if ((a - 0.5) <= -100000000000.0) {
        		tmp = b * a;
        	} else if ((a - 0.5) <= -0.4) {
        		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) :: tmp
            if ((a - 0.5d0) <= (-100000000000.0d0)) then
                tmp = b * a
            else if ((a - 0.5d0) <= (-0.4d0)) 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 tmp;
        	if ((a - 0.5) <= -100000000000.0) {
        		tmp = b * a;
        	} else if ((a - 0.5) <= -0.4) {
        		tmp = -0.5 * b;
        	} else {
        		tmp = b * a;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a, b):
        	tmp = 0
        	if (a - 0.5) <= -100000000000.0:
        		tmp = b * a
        	elif (a - 0.5) <= -0.4:
        		tmp = -0.5 * b
        	else:
        		tmp = b * a
        	return tmp
        
        function code(x, y, z, t, a, b)
        	tmp = 0.0
        	if (Float64(a - 0.5) <= -100000000000.0)
        		tmp = Float64(b * a);
        	elseif (Float64(a - 0.5) <= -0.4)
        		tmp = Float64(-0.5 * b);
        	else
        		tmp = Float64(b * a);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a, b)
        	tmp = 0.0;
        	if ((a - 0.5) <= -100000000000.0)
        		tmp = b * a;
        	elseif ((a - 0.5) <= -0.4)
        		tmp = -0.5 * b;
        	else
        		tmp = b * a;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(a - 0.5), $MachinePrecision], -100000000000.0], N[(b * a), $MachinePrecision], If[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4], N[(-0.5 * b), $MachinePrecision], N[(b * a), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;a - 0.5 \leq -100000000000:\\
        \;\;\;\;b \cdot a\\
        
        \mathbf{elif}\;a - 0.5 \leq -0.4:\\
        \;\;\;\;-0.5 \cdot b\\
        
        \mathbf{else}:\\
        \;\;\;\;b \cdot a\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (-.f64 a #s(literal 1/2 binary64)) < -1e11 or -0.40000000000000002 < (-.f64 a #s(literal 1/2 binary64))

          1. Initial program 99.9%

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

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

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

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

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

          if -1e11 < (-.f64 a #s(literal 1/2 binary64)) < -0.40000000000000002

          1. Initial program 99.8%

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

            \[\leadsto \color{blue}{\left(y + \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(y + \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(y + \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(y + \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(y + \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(y + \left(z + b \cdot \left(a - \frac{1}{2}\right)\right)\right)} \]
            6. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto b \cdot \frac{-1}{2} \]
          10. Step-by-step derivation
            1. Applied rewrites25.6%

              \[\leadsto b \cdot -0.5 \]
          11. Recombined 2 regimes into one program.
          12. Final simplification37.5%

            \[\leadsto \begin{array}{l} \mathbf{if}\;a - 0.5 \leq -100000000000:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;a - 0.5 \leq -0.4:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{else}:\\ \;\;\;\;b \cdot a\\ \end{array} \]
          13. Add Preprocessing

          Alternative 9: 78.7% accurate, 9.7× speedup?

          \[\begin{array}{l} \\ \mathsf{fma}\left(a - 0.5, b, y + x\right) \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 fma(Float64(a - 0.5), b, Float64(y + x))
          end
          
          code[x_, y_, z_, t_, a_, b_] := N[(N[(a - 0.5), $MachinePrecision] * b + N[(y + x), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \mathsf{fma}\left(a - 0.5, b, y + x\right)
          \end{array}
          
          Derivation
          1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

          Alternative 10: 58.4% accurate, 12.6× speedup?

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

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

            \[\leadsto \color{blue}{\left(y + \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(y + \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(y + \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(y + \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(y + \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(y + \left(z + b \cdot \left(a - \frac{1}{2}\right)\right)\right)} \]
            6. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 11: 38.5% accurate, 14.0× speedup?

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

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

              \[\leadsto \color{blue}{\left(y + \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(y + \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(y + \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(y + \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(y + \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(y + \left(z + b \cdot \left(a - \frac{1}{2}\right)\right)\right)} \]
              6. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 12: 26.2% accurate, 21.0× speedup?

            \[\begin{array}{l} \\ b \cdot a \end{array} \]
            (FPCore (x y z t a b) :precision binary64 (* b a))
            double code(double x, double y, double z, double t, double a, double b) {
            	return b * a;
            }
            
            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 = b * a
            end function
            
            public static double code(double x, double y, double z, double t, double a, double b) {
            	return b * a;
            }
            
            def code(x, y, z, t, a, b):
            	return b * a
            
            function code(x, y, z, t, a, b)
            	return Float64(b * a)
            end
            
            function tmp = code(x, y, z, t, a, b)
            	tmp = b * a;
            end
            
            code[x_, y_, z_, t_, a_, b_] := N[(b * a), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            b \cdot a
            \end{array}
            
            Derivation
            1. Initial program 99.9%

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

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

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

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

              \[\leadsto \color{blue}{b \cdot a} \]
            6. Add Preprocessing

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

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

            Reproduce

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