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

Percentage Accurate: 99.8% → 99.8%
Time: 6.3s
Alternatives: 13
Speedup: 1.1×

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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    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}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 99.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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    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.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, \left(a + t\right) + \mathsf{fma}\left(\log y, x, z\right)\right)\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (fma y i (fma (log c) (- b 0.5) (+ (+ a t) (fma (log y) x z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return fma(y, i, fma(log(c), (b - 0.5), ((a + t) + fma(log(y), x, z))));
}
function code(x, y, z, t, a, b, c, i)
	return fma(y, i, fma(log(c), Float64(b - 0.5), Float64(Float64(a + t) + fma(log(y), x, z))))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[(a + t), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, \left(a + t\right) + \mathsf{fma}\left(\log y, x, z\right)\right)\right)
\end{array}
Derivation
  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. Step-by-step derivation
    1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 85.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \left(\left(\mathsf{fma}\left(\log y, x, z\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
 (+ (+ (+ (fma (log y) x 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) {
	return ((fma(log(y), x, z) + a) + ((b - 0.5) * log(c))) + (y * i);
}
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(fma(log(y), x, z) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[Log[y], $MachinePrecision] * x + z), $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(\mathsf{fma}\left(\log y, x, z\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}
Derivation
  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. Taylor expanded in t around 0

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

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

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

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

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

      \[\leadsto \left(\left(\mathsf{fma}\left(\log y, x, z\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
    6. lift-log.f6484.5

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

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

Alternative 3: 85.0% accurate, 0.5× 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 -50:\\ \;\;\;\;\left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, \log c \cdot \left(b - 0.5\right)\right)\right) + t\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))
      -50.0)
   (+ (+ (fma i y (fma (log c) (- b 0.5) (* (log y) x))) z) t)
   (+ (+ (fma i y (fma (log y) x (* (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)) <= -50.0) {
		tmp = (fma(i, y, fma(log(c), (b - 0.5), (log(y) * x))) + z) + t;
	} else {
		tmp = (fma(i, y, fma(log(y), x, (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)) <= -50.0)
		tmp = Float64(Float64(fma(i, y, fma(log(c), Float64(b - 0.5), Float64(log(y) * x))) + z) + t);
	else
		tmp = Float64(Float64(fma(i, y, fma(log(y), x, Float64(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], -50.0], N[(N[(N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision], N[(N[(N[(i * y + N[(N[Log[y], $MachinePrecision] * x + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $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 -50:\\
\;\;\;\;\left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t\\

\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, \log c \cdot \left(b - 0.5\right)\right)\right) + t\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)) < -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. 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)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
      12. lift-log.f6484.8

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

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

    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))

    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. 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)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + t\right) + a \]
      12. lift-log.f6484.8

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + t\right) + a \]
      13. lift--.f6484.8

        \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, \log c \cdot \left(b - 0.5\right)\right)\right) + t\right) + a \]
    6. Applied rewrites84.8%

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

Alternative 4: 84.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\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 -50:\\ \;\;\;\;\left(t\_1 + z\right) + t\\ \mathbf{else}:\\ \;\;\;\;\left(t\_1 + t\right) + a\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (fma i y (fma (log c) (- b 0.5) (* (log y) x)))))
   (if (<=
        (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i))
        -50.0)
     (+ (+ t_1 z) t)
     (+ (+ t_1 t) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = fma(i, y, fma(log(c), (b - 0.5), (log(y) * x)));
	double tmp;
	if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i)) <= -50.0) {
		tmp = (t_1 + z) + t;
	} else {
		tmp = (t_1 + t) + a;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = fma(i, y, fma(log(c), Float64(b - 0.5), Float64(log(y) * x)))
	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)) <= -50.0)
		tmp = Float64(Float64(t_1 + z) + t);
	else
		tmp = Float64(Float64(t_1 + t) + a);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $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], -50.0], N[(N[(t$95$1 + z), $MachinePrecision] + t), $MachinePrecision], N[(N[(t$95$1 + t), $MachinePrecision] + a), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\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 -50:\\
\;\;\;\;\left(t\_1 + z\right) + t\\

\mathbf{else}:\\
\;\;\;\;\left(t\_1 + t\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)) < -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. 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)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
      12. lift-log.f6484.8

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

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

    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))

    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. 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)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + t\right) + a \]
      12. lift-log.f6484.8

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

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

Alternative 5: 79.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;b \leq 3.3 \cdot 10^{+160}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(-0.5, \log c, \mathsf{fma}\left(x, \log y, z\right) + a\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -6.7999999999999998e158 or 3.2999999999999997e160 < b

    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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, z\right) + t\right) + a\right) \]
      8. lift--.f6484.3

        \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\right) \]
    6. Applied rewrites84.3%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - \frac{1}{2}, \log c, z\right) + a\right) \]
      7. lift-log.f6469.3

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

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

    if -6.7999999999999998e158 < b < 3.2999999999999997e160

    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. Taylor expanded in t around 0

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{fma}\left(\log y, x, z\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
      6. lift-log.f6484.5

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{y \cdot i} + \left(\left(\mathsf{fma}\left(\log y, x, z\right) + a\right) + \frac{-1}{2} \cdot \log c\right) \]
        6. lower-fma.f6469.3

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log y, x, z\right) + a\right) + \color{blue}{\log c} \cdot \frac{-1}{2}\right) \]
      3. Applied rewrites69.3%

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

    Alternative 6: 72.2% accurate, 1.2× speedup?

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

      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. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, z\right) + t\right) + a\right) \]
        8. lift--.f6484.3

          \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\right) \]
      6. Applied rewrites84.3%

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - \frac{1}{2}, \log c, z\right) + a\right) \]
        7. lift-log.f6469.3

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

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

      if 4.4999999999999999e230 < 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. 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)} \]
      3. Step-by-step derivation
        1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + t\right) + a \]
        12. lift-log.f6484.8

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\left(\log c \cdot \left(b - \frac{1}{2}\right) + \log y \cdot x\right) + t\right) + a \]
        8. lift-fma.f64N/A

          \[\leadsto \left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right) + t\right) + a \]
        9. lift--.f6461.9

          \[\leadsto \left(\mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right) + t\right) + a \]
      7. Applied rewrites61.9%

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

    Alternative 7: 71.8% accurate, 1.3× speedup?

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

      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. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, z\right) + t\right) + a\right) \]
        8. lift--.f6484.3

          \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\right) \]
      6. Applied rewrites84.3%

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - \frac{1}{2}, \log c, z\right) + a\right) \]
        7. lift-log.f6469.3

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

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

      if 4.4999999999999999e230 < 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. 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)} \]
      3. Step-by-step derivation
        1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + t\right) + a \]
        12. lift-log.f6484.8

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\left(\log c \cdot \left(b - \frac{1}{2}\right) + \log y \cdot x\right) + t\right) + a \]
        8. lift-fma.f64N/A

          \[\leadsto \left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right) + t\right) + a \]
        9. lift--.f6461.9

          \[\leadsto \left(\mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right) + t\right) + a \]
      7. Applied rewrites61.9%

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

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

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

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

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

            \[\leadsto \left(\left(\log c \cdot \frac{-1}{2} + \log y \cdot x\right) + t\right) + a \]
          4. lift-*.f64N/A

            \[\leadsto \left(\left(\log c \cdot \frac{-1}{2} + \log y \cdot x\right) + t\right) + a \]
          5. lift-log.f64N/A

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

            \[\leadsto \left(\log c \cdot \frac{-1}{2} + \left(\log y \cdot x + t\right)\right) + a \]
          7. lift-*.f64N/A

            \[\leadsto \left(\log c \cdot \frac{-1}{2} + \left(\log y \cdot x + t\right)\right) + a \]
          8. lift-log.f64N/A

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

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

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

            \[\leadsto \mathsf{fma}\left(\log c, \frac{-1}{2}, t + x \cdot \log y\right) + a \]
          12. lift-log.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(\log c, \frac{-1}{2}, \mathsf{fma}\left(x, \log y, t\right)\right) + a \]
          15. lift-log.f6446.8

            \[\leadsto \mathsf{fma}\left(\log c, -0.5, \mathsf{fma}\left(x, \log y, t\right)\right) + a \]
        3. Applied rewrites46.8%

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

      Alternative 8: 69.3% accurate, 1.7× speedup?

      \[\begin{array}{l} \\ \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, z\right) + a\right) \end{array} \]
      (FPCore (x y z t a b c i)
       :precision binary64
       (fma y i (+ (fma (- b 0.5) (log c) z) a)))
      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
      	return fma(y, i, (fma((b - 0.5), log(c), z) + a));
      }
      
      function code(x, y, z, t, a, b, c, i)
      	return fma(y, i, Float64(fma(Float64(b - 0.5), log(c), z) + a))
      end
      
      code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, z\right) + a\right)
      \end{array}
      
      Derivation
      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. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, z\right) + t\right) + a\right) \]
        8. lift--.f6484.3

          \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\right) \]
      6. Applied rewrites84.3%

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - \frac{1}{2}, \log c, z\right) + a\right) \]
        7. lift-log.f6469.3

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

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

      Alternative 9: 63.2% accurate, 1.2× speedup?

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

        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. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, z\right) + t\right) + a\right) \]
          8. lift--.f6484.3

            \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\right) \]
        6. Applied rewrites84.3%

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - \frac{1}{2}, \log c, z\right) + a\right) \]
          7. lift-log.f6469.3

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - \frac{1}{2}, \log c, a\right)\right) \]
          4. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - \frac{1}{2}, \log c, a\right)\right) \]
          5. lift-log.f6454.8

            \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, a\right)\right) \]
        12. Applied rewrites54.8%

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

        if -1e206 < (-.f64 b #s(literal 1/2 binary64)) < 4.99999999999999994e203

        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. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, z\right) + t\right) + a\right) \]
          8. lift--.f6484.3

            \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\right) \]
        6. Applied rewrites84.3%

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - \frac{1}{2}, \log c, z\right) + a\right) \]
          7. lift-log.f6469.3

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

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

          \[\leadsto \mathsf{fma}\left(y, i, \left(z + \frac{-1}{2} \cdot \log c\right) + a\right) \]
        11. Step-by-step derivation
          1. +-commutativeN/A

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

            \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(\frac{-1}{2}, \log c, z\right) + a\right) \]
          3. lift-log.f6454.4

            \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(-0.5, \log c, z\right) + a\right) \]
        12. Applied rewrites54.4%

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

      Alternative 10: 58.7% accurate, 2.0× speedup?

      \[\begin{array}{l} \\ \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, a\right)\right) \end{array} \]
      (FPCore (x y z t a b c i)
       :precision binary64
       (fma y i (fma (- b 0.5) (log c) a)))
      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
      	return fma(y, i, fma((b - 0.5), log(c), a));
      }
      
      function code(x, y, z, t, a, b, c, i)
      	return fma(y, i, fma(Float64(b - 0.5), log(c), a))
      end
      
      code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, a\right)\right)
      \end{array}
      
      Derivation
      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. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, z\right) + t\right) + a\right) \]
        8. lift--.f6484.3

          \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\right) \]
      6. Applied rewrites84.3%

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - \frac{1}{2}, \log c, z\right) + a\right) \]
        7. lift-log.f6469.3

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - \frac{1}{2}, \log c, a\right)\right) \]
        4. lift--.f64N/A

          \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - \frac{1}{2}, \log c, a\right)\right) \]
        5. lift-log.f6454.8

          \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, a\right)\right) \]
      12. Applied rewrites54.8%

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, a\right)\right) \]
      13. Add Preprocessing

      Alternative 11: 54.8% accurate, 0.4× 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 -4 \cdot 10^{+307}:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;t\_1 \leq 10^{+308}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, t\right) + a\\ \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 -4e+307)
           (* i y)
           (if (<= t_1 1e+308) (+ (fma (- b 0.5) (log c) t) a) (* 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 <= -4e+307) {
      		tmp = i * y;
      	} else if (t_1 <= 1e+308) {
      		tmp = fma((b - 0.5), log(c), t) + a;
      	} 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 <= -4e+307)
      		tmp = Float64(i * y);
      	elseif (t_1 <= 1e+308)
      		tmp = Float64(fma(Float64(b - 0.5), log(c), t) + a);
      	else
      		tmp = Float64(i * y);
      	end
      	return 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, -4e+307], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, 1e+308], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + t), $MachinePrecision] + a), $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 -4 \cdot 10^{+307}:\\
      \;\;\;\;i \cdot y\\
      
      \mathbf{elif}\;t\_1 \leq 10^{+308}:\\
      \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, t\right) + a\\
      
      \mathbf{else}:\\
      \;\;\;\;i \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)) < -3.99999999999999994e307 or 1e308 < (+.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.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. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, z\right) + t\right) + a\right) \]
          8. lift--.f6484.3

            \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\right) \]
        6. Applied rewrites84.3%

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

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

            \[\leadsto i \cdot \color{blue}{y} \]
        9. Applied rewrites24.8%

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

        if -3.99999999999999994e307 < (+.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)) < 1e308

        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. 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)} \]
        3. Step-by-step derivation
          1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + t\right) + a \]
          12. lift-log.f6484.8

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\left(\log c \cdot \left(b - \frac{1}{2}\right) + \log y \cdot x\right) + t\right) + a \]
          8. lift-fma.f64N/A

            \[\leadsto \left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right) + t\right) + a \]
          9. lift--.f6461.9

            \[\leadsto \left(\mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right) + t\right) + a \]
        7. Applied rewrites61.9%

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

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

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

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

            \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, t\right) + a \]
          4. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, t\right) + a \]
          5. lift-log.f6446.7

            \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, t\right) + a \]
        10. Applied rewrites46.7%

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

      Alternative 12: 32.3% accurate, 1.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log c \cdot b\\ \mathbf{if}\;b - 0.5 \leq -8 \cdot 10^{+158}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b - 0.5 \leq 5 \cdot 10^{+205}:\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t a b c i)
       :precision binary64
       (let* ((t_1 (* (log c) b)))
         (if (<= (- b 0.5) -8e+158) t_1 (if (<= (- b 0.5) 5e+205) (* i y) t_1))))
      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
      	double t_1 = log(c) * b;
      	double tmp;
      	if ((b - 0.5) <= -8e+158) {
      		tmp = t_1;
      	} else if ((b - 0.5) <= 5e+205) {
      		tmp = i * y;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, t, a, b, c, i)
      use fmin_fmax_functions
          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) :: t_1
          real(8) :: tmp
          t_1 = log(c) * b
          if ((b - 0.5d0) <= (-8d+158)) then
              tmp = t_1
          else if ((b - 0.5d0) <= 5d+205) then
              tmp = i * y
          else
              tmp = t_1
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
      	double t_1 = Math.log(c) * b;
      	double tmp;
      	if ((b - 0.5) <= -8e+158) {
      		tmp = t_1;
      	} else if ((b - 0.5) <= 5e+205) {
      		tmp = i * y;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b, c, i):
      	t_1 = math.log(c) * b
      	tmp = 0
      	if (b - 0.5) <= -8e+158:
      		tmp = t_1
      	elif (b - 0.5) <= 5e+205:
      		tmp = i * y
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t, a, b, c, i)
      	t_1 = Float64(log(c) * b)
      	tmp = 0.0
      	if (Float64(b - 0.5) <= -8e+158)
      		tmp = t_1;
      	elseif (Float64(b - 0.5) <= 5e+205)
      		tmp = Float64(i * y);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b, c, i)
      	t_1 = log(c) * b;
      	tmp = 0.0;
      	if ((b - 0.5) <= -8e+158)
      		tmp = t_1;
      	elseif ((b - 0.5) <= 5e+205)
      		tmp = i * y;
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[N[(b - 0.5), $MachinePrecision], -8e+158], t$95$1, If[LessEqual[N[(b - 0.5), $MachinePrecision], 5e+205], N[(i * y), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \log c \cdot b\\
      \mathbf{if}\;b - 0.5 \leq -8 \cdot 10^{+158}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;b - 0.5 \leq 5 \cdot 10^{+205}:\\
      \;\;\;\;i \cdot y\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (-.f64 b #s(literal 1/2 binary64)) < -7.99999999999999962e158 or 5.0000000000000002e205 < (-.f64 b #s(literal 1/2 binary64))

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

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

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

            \[\leadsto \log c \cdot \color{blue}{b} \]
          3. lift-log.f6416.6

            \[\leadsto \log c \cdot b \]
        4. Applied rewrites16.6%

          \[\leadsto \color{blue}{\log c \cdot b} \]

        if -7.99999999999999962e158 < (-.f64 b #s(literal 1/2 binary64)) < 5.0000000000000002e205

        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. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, z\right) + t\right) + a\right) \]
          8. lift--.f6484.3

            \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\right) \]
        6. Applied rewrites84.3%

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

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

            \[\leadsto i \cdot \color{blue}{y} \]
        9. Applied rewrites24.8%

          \[\leadsto \color{blue}{i \cdot y} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 13: 24.8% accurate, 9.5× 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;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, t, a, b, c, i)
      use fmin_fmax_functions
          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.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. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, z\right) + t\right) + a\right) \]
        8. lift--.f6484.3

          \[\leadsto \mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\right) \]
      6. Applied rewrites84.3%

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

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

          \[\leadsto i \cdot \color{blue}{y} \]
      9. Applied rewrites24.8%

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

      Reproduce

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