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

Percentage Accurate: 99.8% → 99.8%
Time: 11.1s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 17.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;t\_1 \leq -50:\\ \;\;\;\;\frac{z}{y} \cdot y\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{a}{y} \cdot y\\ \mathbf{else}:\\ \;\;\;\;i \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1
         (+
          (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
          (* y i))))
   (if (<= t_1 (- INFINITY))
     (* i y)
     (if (<= t_1 -50.0)
       (* (/ z y) y)
       (if (<= t_1 INFINITY) (* (/ a y) y) (* i y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = i * y;
	} else if (t_1 <= -50.0) {
		tmp = (z / y) * y;
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = (a / y) * y;
	} else {
		tmp = i * y;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = i * y;
	} else if (t_1 <= -50.0) {
		tmp = (z / y) * y;
	} else if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = (a / y) * y;
	} else {
		tmp = i * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
	tmp = 0
	if t_1 <= -math.inf:
		tmp = i * y
	elif t_1 <= -50.0:
		tmp = (z / y) * y
	elif t_1 <= math.inf:
		tmp = (a / y) * y
	else:
		tmp = i * y
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(i * y);
	elseif (t_1 <= -50.0)
		tmp = Float64(Float64(z / y) * y);
	elseif (t_1 <= Inf)
		tmp = Float64(Float64(a / y) * y);
	else
		tmp = Float64(i * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = i * y;
	elseif (t_1 <= -50.0)
		tmp = (z / y) * y;
	elseif (t_1 <= Inf)
		tmp = (a / y) * y;
	else
		tmp = i * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -50.0], N[(N[(z / y), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(a / y), $MachinePrecision] * y), $MachinePrecision], N[(i * y), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;i \cdot y\\

\mathbf{elif}\;t\_1 \leq -50:\\
\;\;\;\;\frac{z}{y} \cdot y\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{a}{y} \cdot y\\

\mathbf{else}:\\
\;\;\;\;i \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -inf.0 or +inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

    1. Initial program 94.4%

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

      \[\leadsto \color{blue}{i \cdot y} \]
    4. Step-by-step derivation
      1. lower-*.f64100.0

        \[\leadsto \color{blue}{i \cdot y} \]
    5. Applied rewrites100.0%

      \[\leadsto \color{blue}{i \cdot y} \]

    if -inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -50

    1. Initial program 99.8%

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

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

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

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

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

      \[\leadsto \frac{z}{y} \cdot y \]
    7. Step-by-step derivation
      1. Applied rewrites9.7%

        \[\leadsto \frac{z}{y} \cdot y \]

      if -50 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < +inf.0

      1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto \frac{t}{y} \cdot y \]
      7. Step-by-step derivation
        1. Applied rewrites12.9%

          \[\leadsto \frac{t}{y} \cdot y \]
        2. Taylor expanded in a around inf

          \[\leadsto \frac{a}{y} \cdot y \]
        3. Step-by-step derivation
          1. Applied rewrites12.6%

            \[\leadsto \frac{a}{y} \cdot y \]
        4. Recombined 3 regimes into one program.
        5. Add Preprocessing

        Alternative 3: 18.3% accurate, 0.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq 2 \cdot 10^{+25} \lor \neg \left(t\_1 \leq \infty\right):\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{y} \cdot y\\ \end{array} \end{array} \]
        (FPCore (x y z t a b c i)
         :precision binary64
         (let* ((t_1
                 (+
                  (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                  (* y i))))
           (if (or (<= t_1 2e+25) (not (<= t_1 INFINITY))) (* i y) (* (/ a y) y))))
        double code(double x, double y, double z, double t, double a, double b, double c, double i) {
        	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
        	double tmp;
        	if ((t_1 <= 2e+25) || !(t_1 <= ((double) INFINITY))) {
        		tmp = i * y;
        	} else {
        		tmp = (a / y) * y;
        	}
        	return tmp;
        }
        
        public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
        	double t_1 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
        	double tmp;
        	if ((t_1 <= 2e+25) || !(t_1 <= Double.POSITIVE_INFINITY)) {
        		tmp = i * y;
        	} else {
        		tmp = (a / y) * y;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a, b, c, i):
        	t_1 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
        	tmp = 0
        	if (t_1 <= 2e+25) or not (t_1 <= math.inf):
        		tmp = i * y
        	else:
        		tmp = (a / y) * y
        	return tmp
        
        function code(x, y, z, t, a, b, c, i)
        	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
        	tmp = 0.0
        	if ((t_1 <= 2e+25) || !(t_1 <= Inf))
        		tmp = Float64(i * y);
        	else
        		tmp = Float64(Float64(a / y) * y);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a, b, c, i)
        	t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
        	tmp = 0.0;
        	if ((t_1 <= 2e+25) || ~((t_1 <= Inf)))
        		tmp = i * y;
        	else
        		tmp = (a / y) * y;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, 2e+25], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]], N[(i * y), $MachinePrecision], N[(N[(a / y), $MachinePrecision] * y), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
        \mathbf{if}\;t\_1 \leq 2 \cdot 10^{+25} \lor \neg \left(t\_1 \leq \infty\right):\\
        \;\;\;\;i \cdot y\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{a}{y} \cdot y\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 2.00000000000000018e25 or +inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

          1. Initial program 99.1%

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

            \[\leadsto \color{blue}{i \cdot y} \]
          4. Step-by-step derivation
            1. lower-*.f6426.9

              \[\leadsto \color{blue}{i \cdot y} \]
          5. Applied rewrites26.9%

            \[\leadsto \color{blue}{i \cdot y} \]

          if 2.00000000000000018e25 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < +inf.0

          1. Initial program 99.9%

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

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

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

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

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

            \[\leadsto \frac{t}{y} \cdot y \]
          7. Step-by-step derivation
            1. Applied rewrites13.1%

              \[\leadsto \frac{t}{y} \cdot y \]
            2. Taylor expanded in a around inf

              \[\leadsto \frac{a}{y} \cdot y \]
            3. Step-by-step derivation
              1. Applied rewrites12.7%

                \[\leadsto \frac{a}{y} \cdot y \]
            4. Recombined 2 regimes into one program.
            5. Final simplification19.8%

              \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq 2 \cdot 10^{+25} \lor \neg \left(\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq \infty\right):\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{y} \cdot y\\ \end{array} \]
            6. Add Preprocessing

            Alternative 4: 84.5% accurate, 0.5× speedup?

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

              1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(\color{blue}{b - \frac{1}{2}}, \log c, t\right)\right) \]
                16. lower-log.f6483.3

                  \[\leadsto \mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \color{blue}{\log c}, t\right)\right) \]
              5. Applied rewrites83.3%

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

              if 2.00000000000000018e25 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

              1. Initial program 99.1%

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

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

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

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

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

            Alternative 5: 69.9% accurate, 0.6× speedup?

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

              1. Initial program 99.9%

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

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

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

                  \[\leadsto \left(\color{blue}{\left(\left(t + z\right) + a\right)} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                3. lower-+.f6485.1

                  \[\leadsto \left(\left(\color{blue}{\left(t + z\right)} + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
              5. Applied rewrites85.1%

                \[\leadsto \left(\color{blue}{\left(\left(t + z\right) + a\right)} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
              6. Taylor expanded in a around 0

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

                  \[\leadsto \left(\left(t + \color{blue}{z}\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                2. Step-by-step derivation
                  1. lift-+.f64N/A

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

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

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

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

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

                    \[\leadsto \left(\color{blue}{\left(b - \frac{1}{2}\right) \cdot \log c} + y \cdot i\right) + \left(t + z\right) \]
                  7. lower-fma.f6468.9

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

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

                    \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{i \cdot y}\right) + \left(t + z\right) \]
                  10. lower-*.f6468.9

                    \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{i \cdot y}\right) + \left(t + z\right) \]
                3. Applied rewrites68.9%

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

                if 2.00000000000000018e25 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                1. Initial program 99.1%

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(i, y, t + \log c \cdot \left(b - \frac{1}{2}\right)\right) + a \]
                7. Step-by-step derivation
                  1. Applied rewrites71.7%

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

                Alternative 6: 69.9% accurate, 0.7× speedup?

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

                  1. Initial program 99.9%

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

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

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

                      \[\leadsto \left(\color{blue}{\left(\left(t + z\right) + a\right)} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                    3. lower-+.f6485.1

                      \[\leadsto \left(\left(\color{blue}{\left(t + z\right)} + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                  5. Applied rewrites85.1%

                    \[\leadsto \left(\color{blue}{\left(\left(t + z\right) + a\right)} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                  6. Taylor expanded in a around 0

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

                      \[\leadsto \left(\left(t + \color{blue}{z}\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                    2. Step-by-step derivation
                      1. lift-+.f64N/A

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\left(b - \frac{1}{2}\right) \cdot \log c} + \left(t + z\right)\right) \]
                      8. lower-fma.f6468.9

                        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, t + z\right)}\right) \]
                    3. Applied rewrites68.9%

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

                    if 2.00000000000000018e25 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                    1. Initial program 99.1%

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(i, y, t + \log c \cdot \left(b - \frac{1}{2}\right)\right) + a \]
                    7. Step-by-step derivation
                      1. Applied rewrites71.7%

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

                    Alternative 7: 93.7% accurate, 1.0× speedup?

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

                      1. Initial program 94.7%

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, t + \frac{-1}{2} \cdot \log c\right)\right) + a \]
                      7. Step-by-step derivation
                        1. Applied rewrites90.3%

                          \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(-0.5, \log c, t\right)\right)\right) + a \]

                        if -1.35e188 < x < 1.6000000000000001e168

                        1. Initial program 99.9%

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

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

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

                            \[\leadsto \left(\color{blue}{\left(\left(t + z\right) + a\right)} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                          3. lower-+.f6497.3

                            \[\leadsto \left(\left(\color{blue}{\left(t + z\right)} + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                        5. Applied rewrites97.3%

                          \[\leadsto \left(\color{blue}{\left(\left(t + z\right) + a\right)} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]

                        if 1.6000000000000001e168 < x

                        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(\color{blue}{b - \frac{1}{2}}, \log c, t\right)\right) \]
                          16. lower-log.f6489.2

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

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

                      Alternative 8: 92.5% accurate, 1.0× speedup?

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

                        1. Initial program 97.5%

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, t + \frac{-1}{2} \cdot \log c\right)\right) + a \]
                        7. Step-by-step derivation
                          1. Applied rewrites89.1%

                            \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(-0.5, \log c, t\right)\right)\right) + a \]

                          if -1.35e188 < x < 5.2000000000000001e178

                          1. Initial program 99.9%

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

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

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

                              \[\leadsto \left(\color{blue}{\left(\left(t + z\right) + a\right)} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                            3. lower-+.f6497.1

                              \[\leadsto \left(\left(\color{blue}{\left(t + z\right)} + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                          5. Applied rewrites97.1%

                            \[\leadsto \left(\color{blue}{\left(\left(t + z\right) + a\right)} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                        8. Recombined 2 regimes into one program.
                        9. Final simplification95.6%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.35 \cdot 10^{+188} \lor \neg \left(x \leq 5.2 \cdot 10^{+178}\right):\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(-0.5, \log c, t\right)\right)\right) + a\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(t + z\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \end{array} \]
                        10. Add Preprocessing

                        Alternative 9: 90.1% accurate, 1.0× speedup?

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

                          1. Initial program 97.1%

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

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

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

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

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

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

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

                            if -3.7e219 < x < 1.45000000000000004e180

                            1. Initial program 99.9%

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

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

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

                                \[\leadsto \left(\color{blue}{\left(\left(t + z\right) + a\right)} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                              3. lower-+.f6496.7

                                \[\leadsto \left(\left(\color{blue}{\left(t + z\right)} + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                            5. Applied rewrites96.7%

                              \[\leadsto \left(\color{blue}{\left(\left(t + z\right) + a\right)} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                          8. Recombined 2 regimes into one program.
                          9. Final simplification94.6%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.7 \cdot 10^{+219} \lor \neg \left(x \leq 1.45 \cdot 10^{+180}\right):\\ \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, -0.5 + b, \log y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(t + z\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \end{array} \]
                          10. Add Preprocessing

                          Alternative 10: 87.7% accurate, 1.7× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -8.8 \cdot 10^{+223} \lor \neg \left(x \leq 1.8 \cdot 10^{+200}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(t + z\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \end{array} \end{array} \]
                          (FPCore (x y z t a b c i)
                           :precision binary64
                           (if (or (<= x -8.8e+223) (not (<= x 1.8e+200)))
                             (* (log y) x)
                             (+ (+ (+ (+ t z) a) (* (- b 0.5) (log c))) (* y i))))
                          double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                          	double tmp;
                          	if ((x <= -8.8e+223) || !(x <= 1.8e+200)) {
                          		tmp = log(y) * x;
                          	} else {
                          		tmp = (((t + z) + a) + ((b - 0.5) * log(c))) + (y * i);
                          	}
                          	return tmp;
                          }
                          
                          real(8) function code(x, y, z, t, a, b, c, i)
                              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), intent (in) :: c
                              real(8), intent (in) :: i
                              real(8) :: tmp
                              if ((x <= (-8.8d+223)) .or. (.not. (x <= 1.8d+200))) then
                                  tmp = log(y) * x
                              else
                                  tmp = (((t + z) + a) + ((b - 0.5d0) * log(c))) + (y * i)
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                          	double tmp;
                          	if ((x <= -8.8e+223) || !(x <= 1.8e+200)) {
                          		tmp = Math.log(y) * x;
                          	} else {
                          		tmp = (((t + z) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
                          	}
                          	return tmp;
                          }
                          
                          def code(x, y, z, t, a, b, c, i):
                          	tmp = 0
                          	if (x <= -8.8e+223) or not (x <= 1.8e+200):
                          		tmp = math.log(y) * x
                          	else:
                          		tmp = (((t + z) + a) + ((b - 0.5) * math.log(c))) + (y * i)
                          	return tmp
                          
                          function code(x, y, z, t, a, b, c, i)
                          	tmp = 0.0
                          	if ((x <= -8.8e+223) || !(x <= 1.8e+200))
                          		tmp = Float64(log(y) * x);
                          	else
                          		tmp = Float64(Float64(Float64(Float64(t + z) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, y, z, t, a, b, c, i)
                          	tmp = 0.0;
                          	if ((x <= -8.8e+223) || ~((x <= 1.8e+200)))
                          		tmp = log(y) * x;
                          	else
                          		tmp = (((t + z) + a) + ((b - 0.5) * log(c))) + (y * i);
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -8.8e+223], N[Not[LessEqual[x, 1.8e+200]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(N[(t + z), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;x \leq -8.8 \cdot 10^{+223} \lor \neg \left(x \leq 1.8 \cdot 10^{+200}\right):\\
                          \;\;\;\;\log y \cdot x\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\left(\left(\left(t + z\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if x < -8.7999999999999999e223 or 1.7999999999999999e200 < x

                            1. Initial program 96.7%

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

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

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

                                \[\leadsto \left(\color{blue}{\left(\left(t + z\right) + a\right)} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                              3. lower-+.f6424.3

                                \[\leadsto \left(\left(\color{blue}{\left(t + z\right)} + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                            5. Applied rewrites24.3%

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

                              \[\leadsto \color{blue}{x \cdot \log y} \]
                            7. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \color{blue}{\log y \cdot x} \]
                              2. lower-*.f64N/A

                                \[\leadsto \color{blue}{\log y \cdot x} \]
                              3. lower-log.f6476.0

                                \[\leadsto \color{blue}{\log y} \cdot x \]
                            8. Applied rewrites76.0%

                              \[\leadsto \color{blue}{\log y \cdot x} \]

                            if -8.7999999999999999e223 < x < 1.7999999999999999e200

                            1. Initial program 99.9%

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

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

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

                                \[\leadsto \left(\color{blue}{\left(\left(t + z\right) + a\right)} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                              3. lower-+.f6495.9

                                \[\leadsto \left(\left(\color{blue}{\left(t + z\right)} + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                            5. Applied rewrites95.9%

                              \[\leadsto \left(\color{blue}{\left(\left(t + z\right) + a\right)} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                          3. Recombined 2 regimes into one program.
                          4. Final simplification93.1%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.8 \cdot 10^{+223} \lor \neg \left(x \leq 1.8 \cdot 10^{+200}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(t + z\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \end{array} \]
                          5. Add Preprocessing

                          Alternative 11: 87.7% accurate, 1.7× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -8.8 \cdot 10^{+223} \lor \neg \left(x \leq 1.8 \cdot 10^{+200}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z\right)\right)\\ \end{array} \end{array} \]
                          (FPCore (x y z t a b c i)
                           :precision binary64
                           (if (or (<= x -8.8e+223) (not (<= x 1.8e+200)))
                             (* (log y) x)
                             (+ (+ a t) (fma (- b 0.5) (log c) (fma i y z)))))
                          double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                          	double tmp;
                          	if ((x <= -8.8e+223) || !(x <= 1.8e+200)) {
                          		tmp = log(y) * x;
                          	} else {
                          		tmp = (a + t) + fma((b - 0.5), log(c), fma(i, y, z));
                          	}
                          	return tmp;
                          }
                          
                          function code(x, y, z, t, a, b, c, i)
                          	tmp = 0.0
                          	if ((x <= -8.8e+223) || !(x <= 1.8e+200))
                          		tmp = Float64(log(y) * x);
                          	else
                          		tmp = Float64(Float64(a + t) + fma(Float64(b - 0.5), log(c), fma(i, y, z)));
                          	end
                          	return tmp
                          end
                          
                          code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -8.8e+223], N[Not[LessEqual[x, 1.8e+200]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], N[(N[(a + t), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;x \leq -8.8 \cdot 10^{+223} \lor \neg \left(x \leq 1.8 \cdot 10^{+200}\right):\\
                          \;\;\;\;\log y \cdot x\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z\right)\right)\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if x < -8.7999999999999999e223 or 1.7999999999999999e200 < x

                            1. Initial program 96.7%

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

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

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

                                \[\leadsto \left(\color{blue}{\left(\left(t + z\right) + a\right)} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                              3. lower-+.f6424.3

                                \[\leadsto \left(\left(\color{blue}{\left(t + z\right)} + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                            5. Applied rewrites24.3%

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

                              \[\leadsto \color{blue}{x \cdot \log y} \]
                            7. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \color{blue}{\log y \cdot x} \]
                              2. lower-*.f64N/A

                                \[\leadsto \color{blue}{\log y \cdot x} \]
                              3. lower-log.f6476.0

                                \[\leadsto \color{blue}{\log y} \cdot x \]
                            8. Applied rewrites76.0%

                              \[\leadsto \color{blue}{\log y \cdot x} \]

                            if -8.7999999999999999e223 < x < 1.7999999999999999e200

                            1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 12: 73.1% accurate, 1.8× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{+221} \lor \neg \left(x \leq 3.5 \cdot 10^{+176}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a\\ \end{array} \end{array} \]
                          (FPCore (x y z t a b c i)
                           :precision binary64
                           (if (or (<= x -4.2e+221) (not (<= x 3.5e+176)))
                             (* (log y) x)
                             (+ (fma i y (fma (log c) (- b 0.5) t)) a)))
                          double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                          	double tmp;
                          	if ((x <= -4.2e+221) || !(x <= 3.5e+176)) {
                          		tmp = log(y) * x;
                          	} else {
                          		tmp = fma(i, y, fma(log(c), (b - 0.5), t)) + a;
                          	}
                          	return tmp;
                          }
                          
                          function code(x, y, z, t, a, b, c, i)
                          	tmp = 0.0
                          	if ((x <= -4.2e+221) || !(x <= 3.5e+176))
                          		tmp = Float64(log(y) * x);
                          	else
                          		tmp = Float64(fma(i, y, fma(log(c), Float64(b - 0.5), t)) + a);
                          	end
                          	return tmp
                          end
                          
                          code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -4.2e+221], N[Not[LessEqual[x, 3.5e+176]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], N[(N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;x \leq -4.2 \cdot 10^{+221} \lor \neg \left(x \leq 3.5 \cdot 10^{+176}\right):\\
                          \;\;\;\;\log y \cdot x\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if x < -4.20000000000000004e221 or 3.50000000000000003e176 < x

                            1. Initial program 97.3%

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

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

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

                                \[\leadsto \left(\color{blue}{\left(\left(t + z\right) + a\right)} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                              3. lower-+.f6430.6

                                \[\leadsto \left(\left(\color{blue}{\left(t + z\right)} + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                            5. Applied rewrites30.6%

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

                              \[\leadsto \color{blue}{x \cdot \log y} \]
                            7. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \color{blue}{\log y \cdot x} \]
                              2. lower-*.f64N/A

                                \[\leadsto \color{blue}{\log y \cdot x} \]
                              3. lower-log.f6469.0

                                \[\leadsto \color{blue}{\log y} \cdot x \]
                            8. Applied rewrites69.0%

                              \[\leadsto \color{blue}{\log y \cdot x} \]

                            if -4.20000000000000004e221 < x < 3.50000000000000003e176

                            1. Initial program 99.9%

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(i, y, t + \log c \cdot \left(b - \frac{1}{2}\right)\right) + a \]
                            7. Step-by-step derivation
                              1. Applied rewrites80.2%

                                \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a \]
                            8. Recombined 2 regimes into one program.
                            9. Final simplification78.3%

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

                            Alternative 13: 74.6% accurate, 1.9× speedup?

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

                              1. Initial program 100.0%

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

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

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

                                  \[\leadsto \left(\color{blue}{\left(\left(t + z\right) + a\right)} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                3. lower-+.f6490.4

                                  \[\leadsto \left(\left(\color{blue}{\left(t + z\right)} + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                              5. Applied rewrites90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                if -5.80000000000000013e38 < z

                                1. Initial program 99.4%

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(i, y, t + \log c \cdot \left(b - \frac{1}{2}\right)\right) + a \]
                                7. Step-by-step derivation
                                  1. Applied rewrites74.8%

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

                                Alternative 14: 38.1% accurate, 7.8× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -2.7 \cdot 10^{+72} \lor \neg \left(i \leq 1.9 \cdot 10^{+65}\right):\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{a}, a, a\right)\\ \end{array} \end{array} \]
                                (FPCore (x y z t a b c i)
                                 :precision binary64
                                 (if (or (<= i -2.7e+72) (not (<= i 1.9e+65))) (* i y) (fma (/ z a) a a)))
                                double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                	double tmp;
                                	if ((i <= -2.7e+72) || !(i <= 1.9e+65)) {
                                		tmp = i * y;
                                	} else {
                                		tmp = fma((z / a), a, a);
                                	}
                                	return tmp;
                                }
                                
                                function code(x, y, z, t, a, b, c, i)
                                	tmp = 0.0
                                	if ((i <= -2.7e+72) || !(i <= 1.9e+65))
                                		tmp = Float64(i * y);
                                	else
                                		tmp = fma(Float64(z / a), a, a);
                                	end
                                	return tmp
                                end
                                
                                code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -2.7e+72], N[Not[LessEqual[i, 1.9e+65]], $MachinePrecision]], N[(i * y), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * a + a), $MachinePrecision]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;i \leq -2.7 \cdot 10^{+72} \lor \neg \left(i \leq 1.9 \cdot 10^{+65}\right):\\
                                \;\;\;\;i \cdot y\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\mathsf{fma}\left(\frac{z}{a}, a, a\right)\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if i < -2.7000000000000001e72 or 1.90000000000000006e65 < i

                                  1. Initial program 98.8%

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

                                    \[\leadsto \color{blue}{i \cdot y} \]
                                  4. Step-by-step derivation
                                    1. lower-*.f6456.8

                                      \[\leadsto \color{blue}{i \cdot y} \]
                                  5. Applied rewrites56.8%

                                    \[\leadsto \color{blue}{i \cdot y} \]

                                  if -2.7000000000000001e72 < i < 1.90000000000000006e65

                                  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \log c, t\right)\right)}{a}, a, a\right)} \]
                                  6. Step-by-step derivation
                                    1. Applied rewrites67.4%

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

                                      \[\leadsto \mathsf{fma}\left(\frac{z}{a}, a, a\right) \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites31.3%

                                        \[\leadsto \mathsf{fma}\left(\frac{z}{a}, a, a\right) \]
                                    4. Recombined 2 regimes into one program.
                                    5. Final simplification40.6%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -2.7 \cdot 10^{+72} \lor \neg \left(i \leq 1.9 \cdot 10^{+65}\right):\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{a}, a, a\right)\\ \end{array} \]
                                    6. Add Preprocessing

                                    Alternative 15: 38.1% accurate, 8.1× speedup?

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

                                      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \log c, t\right)\right)}{a}, a, a\right)} \]
                                      6. Step-by-step derivation
                                        1. Applied rewrites62.6%

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

                                          \[\leadsto \mathsf{fma}\left(\frac{z}{a}, a, a\right) \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites36.3%

                                            \[\leadsto \mathsf{fma}\left(\frac{z}{a}, a, a\right) \]

                                          if -2.70000000000000015e144 < z

                                          1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \mathsf{fma}\left(\frac{i \cdot y}{a}, a, a\right) \]
                                          7. Step-by-step derivation
                                            1. Applied rewrites40.0%

                                              \[\leadsto \mathsf{fma}\left(\frac{i \cdot y}{a}, a, a\right) \]
                                          8. Recombined 2 regimes into one program.
                                          9. Final simplification39.6%

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+144}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{a}, a, a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{i \cdot y}{a}, a, a\right)\\ \end{array} \]
                                          10. Add Preprocessing

                                          Alternative 16: 25.1% accurate, 39.0× speedup?

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

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

                                            \[\leadsto \color{blue}{i \cdot y} \]
                                          4. Step-by-step derivation
                                            1. lower-*.f6427.3

                                              \[\leadsto \color{blue}{i \cdot y} \]
                                          5. Applied rewrites27.3%

                                            \[\leadsto \color{blue}{i \cdot y} \]
                                          6. Add Preprocessing

                                          Reproduce

                                          ?
                                          herbie shell --seed 2024313 
                                          (FPCore (x y z t a b c i)
                                            :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, B"
                                            :precision binary64
                                            (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))