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

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

\\
\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(x, \log y, t\right)\right) + 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 \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 \]
    2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.0% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;a + \left(t + \left(z + \mathsf{fma}\left(i, y, t\_1\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 6.2000000000000004e124

    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 \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 \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\log c, \mathsf{fma}\left(b, b, -0.25\right) \cdot \color{blue}{\frac{1}{b - -0.5}}, t + \mathsf{fma}\left(\log y, x, z\right)\right) + a\right) + y \cdot i \]
    5. Applied rewrites78.6%

      \[\leadsto \left(\mathsf{fma}\left(\log c, \color{blue}{\mathsf{fma}\left(b, b, -0.25\right) \cdot \frac{1}{b - -0.5}}, t + \mathsf{fma}\left(\log y, x, z\right)\right) + a\right) + y \cdot i \]
    6. Applied rewrites61.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{\left(b - 0.5\right) \cdot \log c - a}, \mathsf{fma}\left(b - 0.5, \log c, a\right) \cdot \left(\left(b - 0.5\right) \cdot \log c - a\right), \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, z\right) + t\right)\right)} \]
    7. 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)} \]
    8. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

    if 6.2000000000000004e124 < a

    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 \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 \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\log c, \mathsf{fma}\left(b, b, -0.25\right) \cdot \color{blue}{\frac{1}{b - -0.5}}, t + \mathsf{fma}\left(\log y, x, z\right)\right) + a\right) + y \cdot i \]
    5. Applied rewrites78.6%

      \[\leadsto \left(\mathsf{fma}\left(\log c, \color{blue}{\mathsf{fma}\left(b, b, -0.25\right) \cdot \frac{1}{b - -0.5}}, t + \mathsf{fma}\left(\log y, x, z\right)\right) + a\right) + y \cdot i \]
    6. Applied rewrites61.9%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 90.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq 4.6 \cdot 10^{+164}:\\
\;\;\;\;a + \left(t + \left(z + \mathsf{fma}\left(i, y, t\_1\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.35000000000000003e117 or 4.5999999999999999e164 < 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. Step-by-step derivation
      1. 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 \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\log c, \mathsf{fma}\left(b, b, -0.25\right) \cdot \color{blue}{\frac{1}{b - -0.5}}, t + \mathsf{fma}\left(\log y, x, z\right)\right) + a\right) + y \cdot i \]
    5. Applied rewrites78.6%

      \[\leadsto \left(\mathsf{fma}\left(\log c, \color{blue}{\mathsf{fma}\left(b, b, -0.25\right) \cdot \frac{1}{b - -0.5}}, t + \mathsf{fma}\left(\log y, x, z\right)\right) + a\right) + y \cdot i \]
    6. Applied rewrites61.9%

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

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

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

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

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

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

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

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

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

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

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

    if -2.35000000000000003e117 < x < 4.5999999999999999e164

    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 \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 \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\log c, \mathsf{fma}\left(b, b, -0.25\right) \cdot \color{blue}{\frac{1}{b - -0.5}}, t + \mathsf{fma}\left(\log y, x, z\right)\right) + a\right) + y \cdot i \]
    5. Applied rewrites78.6%

      \[\leadsto \left(\mathsf{fma}\left(\log c, \color{blue}{\mathsf{fma}\left(b, b, -0.25\right) \cdot \frac{1}{b - -0.5}}, t + \mathsf{fma}\left(\log y, x, z\right)\right) + a\right) + y \cdot i \]
    6. Applied rewrites61.9%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 86.4% accurate, 1.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot \log y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 7.3999999999999997e233

    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 \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 \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\log c, \mathsf{fma}\left(b, b, -0.25\right) \cdot \color{blue}{\frac{1}{b - -0.5}}, t + \mathsf{fma}\left(\log y, x, z\right)\right) + a\right) + y \cdot i \]
    5. Applied rewrites78.6%

      \[\leadsto \left(\mathsf{fma}\left(\log c, \color{blue}{\mathsf{fma}\left(b, b, -0.25\right) \cdot \frac{1}{b - -0.5}}, t + \mathsf{fma}\left(\log y, x, z\right)\right) + a\right) + y \cdot i \]
    6. Applied rewrites61.9%

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

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

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

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

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

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

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

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

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

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

    if 7.3999999999999997e233 < 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. Step-by-step derivation
      1. 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 \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\log c, \mathsf{fma}\left(b, b, -0.25\right) \cdot \color{blue}{\frac{1}{b - -0.5}}, t + \mathsf{fma}\left(\log y, x, z\right)\right) + a\right) + y \cdot i \]
    5. Applied rewrites78.6%

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

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

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

        \[\leadsto x \cdot \color{blue}{\log y} \]
      2. lift-log.f6416.6

        \[\leadsto x \cdot \log y \]
    9. Applied rewrites16.6%

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

Alternative 5: 26.0% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;x \leq -4.5 \cdot 10^{+34}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{+162}:\\ \;\;\;\;b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* x (log y))))
   (if (<= x -4.5e+34) t_1 (if (<= x 5.5e+162) (* b (log c)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = x * log(y);
	double tmp;
	if (x <= -4.5e+34) {
		tmp = t_1;
	} else if (x <= 5.5e+162) {
		tmp = b * log(c);
	} 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 = x * log(y)
    if (x <= (-4.5d+34)) then
        tmp = t_1
    else if (x <= 5.5d+162) then
        tmp = b * log(c)
    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 = x * Math.log(y);
	double tmp;
	if (x <= -4.5e+34) {
		tmp = t_1;
	} else if (x <= 5.5e+162) {
		tmp = b * Math.log(c);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = x * math.log(y)
	tmp = 0
	if x <= -4.5e+34:
		tmp = t_1
	elif x <= 5.5e+162:
		tmp = b * math.log(c)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(x * log(y))
	tmp = 0.0
	if (x <= -4.5e+34)
		tmp = t_1;
	elseif (x <= 5.5e+162)
		tmp = Float64(b * log(c));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = x * log(y);
	tmp = 0.0;
	if (x <= -4.5e+34)
		tmp = t_1;
	elseif (x <= 5.5e+162)
		tmp = b * log(c);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.5e+34], t$95$1, If[LessEqual[x, 5.5e+162], N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -4.5 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 5.5 \cdot 10^{+162}:\\
\;\;\;\;b \cdot \log c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.5e34 or 5.49999999999999966e162 < 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. Step-by-step derivation
      1. 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 \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\log c, \mathsf{fma}\left(b, b, -0.25\right) \cdot \color{blue}{\frac{1}{b - -0.5}}, t + \mathsf{fma}\left(\log y, x, z\right)\right) + a\right) + y \cdot i \]
    5. Applied rewrites78.6%

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

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

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

        \[\leadsto x \cdot \color{blue}{\log y} \]
      2. lift-log.f6416.6

        \[\leadsto x \cdot \log y \]
    9. Applied rewrites16.6%

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

    if -4.5e34 < x < 5.49999999999999966e162

    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 \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 \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\log c, \mathsf{fma}\left(b, b, -0.25\right) \cdot \color{blue}{\frac{1}{b - -0.5}}, t + \mathsf{fma}\left(\log y, x, z\right)\right) + a\right) + y \cdot i \]
    5. Applied rewrites78.6%

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

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

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

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

        \[\leadsto b \cdot \log c \]
    9. Applied rewrites16.7%

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

Alternative 6: 16.7% accurate, 3.9× speedup?

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

\\
b \cdot \log c
\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 \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 \]
    2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{fma}\left(\log c, \mathsf{fma}\left(b, b, -0.25\right) \cdot \color{blue}{\frac{1}{b - -0.5}}, t + \mathsf{fma}\left(\log y, x, z\right)\right) + a\right) + y \cdot i \]
  5. Applied rewrites78.6%

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

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

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

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

      \[\leadsto b \cdot \log c \]
  9. Applied rewrites16.7%

    \[\leadsto \color{blue}{b \cdot \log c} \]
  10. Add Preprocessing

Reproduce

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