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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.6% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -2.0000000000000001e152 or 1.9999999999999998e202 < (*.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-+.f6496.4

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

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

    if -2.0000000000000001e152 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.9999999999999998e202

    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(x + \left(y + \left(z + b \cdot \left(a - \frac{1}{2}\right)\right)\right)\right) - z \cdot \log t} \]
    4. Step-by-step derivation
      1. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(1 - \log t, z, \mathsf{fma}\left(a - 0.5, b, y + x\right)\right)} \]
    6. 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} \]
    7. 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 89.3% accurate, 0.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - \log t, z, y + x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -2.0000000000000001e152 or 8.0000000000000003e108 < (*.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.3

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

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

    if -2.0000000000000001e152 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 8.0000000000000003e108

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, y + x\right)} \]
    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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 89.3% accurate, 0.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - \log t, z, y\right) + x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -2.0000000000000001e152 or 8.0000000000000003e108 < (*.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.3

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

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

    if -2.0000000000000001e152 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 8.0000000000000003e108

    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(x + \left(y + \left(z + b \cdot \left(a - \frac{1}{2}\right)\right)\right)\right) - z \cdot \log t} \]
    4. Step-by-step derivation
      1. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(1 - \log t, z, \mathsf{fma}\left(a - 0.5, b, y + x\right)\right)} \]
    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--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 57.9% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) < -5.00000000000000011e-47

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

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

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

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

        \[\leadsto \left(1 + \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)}\right) \cdot z + \left(b \cdot \left(a - \frac{1}{2}\right) + x\right) \]
      13. 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) \]
      14. 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 rewrites76.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 rewrites55.2%

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

      if -5.00000000000000011e-47 < (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t)))

      1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 6: 81.8% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := 1 - \log t\\ \mathbf{if}\;x + y \leq 5 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{fma}\left(t\_1, z, \mathsf{fma}\left(a - 0.5, b, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, b, y\right) + \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 (<= (+ x y) 5e+112)
           (fma t_1 z (fma (- a 0.5) b x))
           (+ (fma -0.5 b 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 ((x + y) <= 5e+112) {
      		tmp = fma(t_1, z, fma((a - 0.5), b, x));
      	} else {
      		tmp = fma(-0.5, b, y) + 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 (Float64(x + y) <= 5e+112)
      		tmp = fma(t_1, z, fma(Float64(a - 0.5), b, x));
      	else
      		tmp = Float64(fma(-0.5, b, y) + 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[N[(x + y), $MachinePrecision], 5e+112], N[(t$95$1 * z + N[(N[(a - 0.5), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * b + y), $MachinePrecision] + N[(t$95$1 * z + x), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := 1 - \log t\\
      \mathbf{if}\;x + y \leq 5 \cdot 10^{+112}:\\
      \;\;\;\;\mathsf{fma}\left(t\_1, z, \mathsf{fma}\left(a - 0.5, b, x\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(-0.5, b, y\right) + \mathsf{fma}\left(t\_1, z, x\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 x y) < 5e112

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

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

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

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

            \[\leadsto \left(1 + \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)}\right) \cdot z + \left(b \cdot \left(a - \frac{1}{2}\right) + x\right) \]
          13. 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) \]
          14. 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 rewrites83.2%

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

        if 5e112 < (+.f64 x y)

        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(1 - \log t, z, \mathsf{fma}\left(a - 0.5, b, y + x\right)\right)} \]
        6. 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} \]
        7. 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 7: 83.7% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+272} \lor \neg \left(z \leq 2.75 \cdot 10^{+166}\right):\\ \;\;\;\;\mathsf{fma}\left(1 - \log t, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y + x\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (if (or (<= z -4.2e+272) (not (<= z 2.75e+166)))
         (fma (- 1.0 (log t)) z 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 ((z <= -4.2e+272) || !(z <= 2.75e+166)) {
      		tmp = fma((1.0 - log(t)), z, x);
      	} else {
      		tmp = fma((a - 0.5), b, (y + x));
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a, b)
      	tmp = 0.0
      	if ((z <= -4.2e+272) || !(z <= 2.75e+166))
      		tmp = fma(Float64(1.0 - log(t)), z, x);
      	else
      		tmp = fma(Float64(a - 0.5), b, Float64(y + x));
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.2e+272], N[Not[LessEqual[z, 2.75e+166]], $MachinePrecision]], N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision], N[(N[(a - 0.5), $MachinePrecision] * b + N[(y + x), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -4.2 \cdot 10^{+272} \lor \neg \left(z \leq 2.75 \cdot 10^{+166}\right):\\
      \;\;\;\;\mathsf{fma}\left(1 - \log t, z, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y + x\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -4.19999999999999991e272 or 2.75000000000000004e166 < 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. *-commutativeN/A

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

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

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

            \[\leadsto \left(1 + \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)}\right) \cdot z + \left(b \cdot \left(a - \frac{1}{2}\right) + x\right) \]
          13. 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) \]
          14. 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 rewrites93.9%

          \[\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 rewrites74.7%

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

          if -4.19999999999999991e272 < z < 2.75000000000000004e166

          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-+.f6487.2

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

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

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

        Alternative 8: 80.9% accurate, 1.1× speedup?

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

          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-+.f6484.9

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

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

          if 3.19999999999999968e166 < z

          1. Initial program 99.7%

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

            \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right)} \]
          4. Step-by-step derivation
            1. 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.8

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

            \[\leadsto \color{blue}{z - \log t \cdot z} \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 9: 37.3% accurate, 5.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a - 0.5 \leq -50 \lor \neg \left(a - 0.5 \leq 2000\right):\\ \;\;\;\;b \cdot a\\ \mathbf{else}:\\ \;\;\;\;b \cdot -0.5\\ \end{array} \end{array} \]
        (FPCore (x y z t a b)
         :precision binary64
         (if (or (<= (- a 0.5) -50.0) (not (<= (- a 0.5) 2000.0))) (* b a) (* b -0.5)))
        double code(double x, double y, double z, double t, double a, double b) {
        	double tmp;
        	if (((a - 0.5) <= -50.0) || !((a - 0.5) <= 2000.0)) {
        		tmp = b * a;
        	} else {
        		tmp = b * -0.5;
        	}
        	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) <= (-50.0d0)) .or. (.not. ((a - 0.5d0) <= 2000.0d0))) then
                tmp = b * a
            else
                tmp = b * (-0.5d0)
            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) <= -50.0) || !((a - 0.5) <= 2000.0)) {
        		tmp = b * a;
        	} else {
        		tmp = b * -0.5;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a, b):
        	tmp = 0
        	if ((a - 0.5) <= -50.0) or not ((a - 0.5) <= 2000.0):
        		tmp = b * a
        	else:
        		tmp = b * -0.5
        	return tmp
        
        function code(x, y, z, t, a, b)
        	tmp = 0.0
        	if ((Float64(a - 0.5) <= -50.0) || !(Float64(a - 0.5) <= 2000.0))
        		tmp = Float64(b * a);
        	else
        		tmp = Float64(b * -0.5);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a, b)
        	tmp = 0.0;
        	if (((a - 0.5) <= -50.0) || ~(((a - 0.5) <= 2000.0)))
        		tmp = b * a;
        	else
        		tmp = b * -0.5;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -50.0], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], 2000.0]], $MachinePrecision]], N[(b * a), $MachinePrecision], N[(b * -0.5), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;a - 0.5 \leq -50 \lor \neg \left(a - 0.5 \leq 2000\right):\\
        \;\;\;\;b \cdot a\\
        
        \mathbf{else}:\\
        \;\;\;\;b \cdot -0.5\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (-.f64 a #s(literal 1/2 binary64)) < -50 or 2e3 < (-.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-*.f6451.7

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

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

          if -50 < (-.f64 a #s(literal 1/2 binary64)) < 2e3

          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(x + \left(y + \left(z + b \cdot \left(a - \frac{1}{2}\right)\right)\right)\right) - z \cdot \log t} \]
          4. Step-by-step derivation
            1. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(1 - \log t, z, \mathsf{fma}\left(a - 0.5, b, y + x\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--.f6423.6

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

            \[\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 rewrites22.8%

              \[\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 -50 \lor \neg \left(a - 0.5 \leq 2000\right):\\ \;\;\;\;b \cdot a\\ \mathbf{else}:\\ \;\;\;\;b \cdot -0.5\\ \end{array} \]
          13. Add Preprocessing

          Alternative 10: 78.8% 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-+.f6478.8

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

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

          Alternative 11: 57.6% accurate, 12.6× speedup?

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

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

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

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

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

              \[\leadsto \left(1 + \color{blue}{\left(\mathsf{neg}\left(\log t\right)\right)}\right) \cdot z + \left(b \cdot \left(a - \frac{1}{2}\right) + x\right) \]
            13. 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) \]
            14. 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 rewrites79.9%

            \[\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 rewrites59.3%

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

            Alternative 12: 37.8% 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(x + \left(y + \left(z + b \cdot \left(a - \frac{1}{2}\right)\right)\right)\right) - z \cdot \log t} \]
            4. Step-by-step derivation
              1. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(1 - \log t, z, \mathsf{fma}\left(a - 0.5, b, y + x\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.1

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

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

            Alternative 13: 25.6% 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-*.f6427.4

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

              \[\leadsto \color{blue}{b \cdot a} \]
            6. 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 2024324 
            (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)))