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

Percentage Accurate: 99.8% → 99.8%
Time: 10.8s
Alternatives: 15
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 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.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}
Derivation
  1. Initial program 99.9%

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

Alternative 2: 30.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq -200:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z}, z, z\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;\frac{a}{i} \cdot i\\

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


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

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{i \cdot y} \]
    5. Applied rewrites93.2%

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

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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 99.8%

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

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

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

            \[\leadsto \frac{a}{i} \cdot i \]
          6. Step-by-step derivation
            1. Applied rewrites13.1%

              \[\leadsto \frac{a}{i} \cdot i \]
          7. Recombined 3 regimes into one program.
          8. Add Preprocessing

          Alternative 3: 23.0% accurate, 0.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+306}:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;t\_1 \leq -200:\\ \;\;\;\;\frac{z}{i} \cdot i\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+306}:\\ \;\;\;\;\frac{a}{i} \cdot i\\ \mathbf{else}:\\ \;\;\;\;i \cdot y\\ \end{array} \end{array} \]
          (FPCore (x y z t a b c i)
           :precision binary64
           (let* ((t_1
                   (+
                    (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                    (* y i))))
             (if (<= t_1 -2e+306)
               (* i y)
               (if (<= t_1 -200.0)
                 (* (/ z i) i)
                 (if (<= t_1 2e+306) (* (/ a i) i) (* i y))))))
          double code(double x, double y, double z, double t, double a, double b, double c, double i) {
          	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
          	double tmp;
          	if (t_1 <= -2e+306) {
          		tmp = i * y;
          	} else if (t_1 <= -200.0) {
          		tmp = (z / i) * i;
          	} else if (t_1 <= 2e+306) {
          		tmp = (a / i) * i;
          	} else {
          		tmp = i * y;
          	}
          	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)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
              if (t_1 <= (-2d+306)) then
                  tmp = i * y
              else if (t_1 <= (-200.0d0)) then
                  tmp = (z / i) * i
              else if (t_1 <= 2d+306) then
                  tmp = (a / i) * i
              else
                  tmp = i * y
              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)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
          	double tmp;
          	if (t_1 <= -2e+306) {
          		tmp = i * y;
          	} else if (t_1 <= -200.0) {
          		tmp = (z / i) * i;
          	} else if (t_1 <= 2e+306) {
          		tmp = (a / i) * i;
          	} else {
          		tmp = i * y;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a, b, c, i):
          	t_1 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
          	tmp = 0
          	if t_1 <= -2e+306:
          		tmp = i * y
          	elif t_1 <= -200.0:
          		tmp = (z / i) * i
          	elif t_1 <= 2e+306:
          		tmp = (a / i) * i
          	else:
          		tmp = i * y
          	return tmp
          
          function code(x, y, z, t, a, b, c, i)
          	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
          	tmp = 0.0
          	if (t_1 <= -2e+306)
          		tmp = Float64(i * y);
          	elseif (t_1 <= -200.0)
          		tmp = Float64(Float64(z / i) * i);
          	elseif (t_1 <= 2e+306)
          		tmp = Float64(Float64(a / i) * i);
          	else
          		tmp = Float64(i * y);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a, b, c, i)
          	t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
          	tmp = 0.0;
          	if (t_1 <= -2e+306)
          		tmp = i * y;
          	elseif (t_1 <= -200.0)
          		tmp = (z / i) * i;
          	elseif (t_1 <= 2e+306)
          		tmp = (a / i) * i;
          	else
          		tmp = i * y;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+306], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -200.0], N[(N[(z / i), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$1, 2e+306], N[(N[(a / i), $MachinePrecision] * i), $MachinePrecision], N[(i * y), $MachinePrecision]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
          \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+306}:\\
          \;\;\;\;i \cdot y\\
          
          \mathbf{elif}\;t\_1 \leq -200:\\
          \;\;\;\;\frac{z}{i} \cdot i\\
          
          \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+306}:\\
          \;\;\;\;\frac{a}{i} \cdot i\\
          
          \mathbf{else}:\\
          \;\;\;\;i \cdot y\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -2.00000000000000003e306 or 2.00000000000000003e306 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

            1. Initial program 100.0%

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

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

                \[\leadsto \color{blue}{i \cdot y} \]
            5. Applied rewrites87.6%

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

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

            1. Initial program 99.9%

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

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

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

              \[\leadsto \frac{z}{i} \cdot i \]
            6. Step-by-step derivation
              1. Applied rewrites9.0%

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

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

              1. Initial program 99.8%

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

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

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

                \[\leadsto \frac{a}{i} \cdot i \]
              6. Step-by-step derivation
                1. Applied rewrites13.1%

                  \[\leadsto \frac{a}{i} \cdot i \]
              7. Recombined 3 regimes into one program.
              8. Add Preprocessing

              Alternative 4: 29.5% accurate, 0.5× speedup?

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

                1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(\frac{i \cdot y}{z}, z, z\right) \]
                    3. Step-by-step derivation
                      1. Applied rewrites39.9%

                        \[\leadsto \mathsf{fma}\left(\frac{i \cdot y}{z}, z, z\right) \]

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

                      1. Initial program 99.8%

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

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

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

                        \[\leadsto \frac{a}{i} \cdot i \]
                      6. Step-by-step derivation
                        1. Applied rewrites13.1%

                          \[\leadsto \frac{a}{i} \cdot i \]
                      7. Recombined 2 regimes into one program.
                      8. Final simplification27.9%

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

                      Alternative 5: 84.9% accurate, 0.5× speedup?

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

                        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        1. Initial program 99.9%

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

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

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

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

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

                      Alternative 6: 69.7% accurate, 0.6× speedup?

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

                        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log y, x, 1 \cdot t\right) \]

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

                            1. Initial program 99.9%

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

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

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

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

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

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

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

                            Alternative 7: 70.0% accurate, 0.7× speedup?

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

                              1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                1. Initial program 99.9%

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

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

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

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

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

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

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

                                Alternative 8: 62.8% accurate, 0.7× speedup?

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

                                  1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -1000000:\\ \;\;\;\;\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - 0.5, t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, y, \log c \cdot \left(b - 0.5\right)\right) + a\\ \end{array} \]
                                      6. Add Preprocessing

                                      Alternative 9: 46.1% accurate, 0.7× speedup?

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

                                        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \mathsf{fma}\left(\frac{i \cdot y}{z}, z, z\right) \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites33.4%

                                                \[\leadsto \mathsf{fma}\left(\frac{i \cdot y}{z}, z, z\right) \]

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

                                              1. Initial program 99.9%

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

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

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

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

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

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

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

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

                                                    \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(-0.5, \log c, t\right)\right) + a \]
                                                4. Recombined 2 regimes into one program.
                                                5. Final simplification44.4%

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -1000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{i \cdot y}{z}, z, z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(-0.5, \log c, t\right)\right) + a\\ \end{array} \]
                                                6. Add Preprocessing

                                                Alternative 10: 91.6% accurate, 1.0× speedup?

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

                                                  1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        \[\leadsto \mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log y, x, 1 \cdot t\right) \]

                                                      if -8.2000000000000005e217 < x < 3.8999999999999998e229

                                                      1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      if 3.8999999999999998e229 < x

                                                      1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      Alternative 11: 89.6% accurate, 1.0× speedup?

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

                                                        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        if 2e53 < a

                                                        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      Alternative 12: 91.8% accurate, 1.7× speedup?

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

                                                        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                            \[\leadsto \mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log y, x, 1 \cdot t\right) \]
                                                          3. Step-by-step derivation
                                                            1. Applied rewrites87.1%

                                                              \[\leadsto \mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log y, x, 1 \cdot t\right) \]

                                                            if -8.2000000000000005e217 < x < 3.0499999999999999e88

                                                            1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                          Alternative 13: 59.8% accurate, 1.9× speedup?

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

                                                            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  \[\leadsto \mathsf{fma}\left(\frac{i \cdot y}{z}, z, z\right) \]
                                                                3. Step-by-step derivation
                                                                  1. Applied rewrites70.4%

                                                                    \[\leadsto \mathsf{fma}\left(\frac{i \cdot y}{z}, z, z\right) \]

                                                                  if -6.1999999999999999e137 < z

                                                                  1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

                                                                    Alternative 14: 25.7% accurate, 10.2× speedup?

                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 3.35 \cdot 10^{+184}:\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{i} \cdot i\\ \end{array} \end{array} \]
                                                                    (FPCore (x y z t a b c i)
                                                                     :precision binary64
                                                                     (if (<= a 3.35e+184) (* i y) (* (/ a i) i)))
                                                                    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                    	double tmp;
                                                                    	if (a <= 3.35e+184) {
                                                                    		tmp = i * y;
                                                                    	} else {
                                                                    		tmp = (a / i) * i;
                                                                    	}
                                                                    	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) :: tmp
                                                                        if (a <= 3.35d+184) then
                                                                            tmp = i * y
                                                                        else
                                                                            tmp = (a / i) * i
                                                                        end if
                                                                        code = tmp
                                                                    end function
                                                                    
                                                                    public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                    	double tmp;
                                                                    	if (a <= 3.35e+184) {
                                                                    		tmp = i * y;
                                                                    	} else {
                                                                    		tmp = (a / i) * i;
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    def code(x, y, z, t, a, b, c, i):
                                                                    	tmp = 0
                                                                    	if a <= 3.35e+184:
                                                                    		tmp = i * y
                                                                    	else:
                                                                    		tmp = (a / i) * i
                                                                    	return tmp
                                                                    
                                                                    function code(x, y, z, t, a, b, c, i)
                                                                    	tmp = 0.0
                                                                    	if (a <= 3.35e+184)
                                                                    		tmp = Float64(i * y);
                                                                    	else
                                                                    		tmp = Float64(Float64(a / i) * i);
                                                                    	end
                                                                    	return tmp
                                                                    end
                                                                    
                                                                    function tmp_2 = code(x, y, z, t, a, b, c, i)
                                                                    	tmp = 0.0;
                                                                    	if (a <= 3.35e+184)
                                                                    		tmp = i * y;
                                                                    	else
                                                                    		tmp = (a / i) * i;
                                                                    	end
                                                                    	tmp_2 = tmp;
                                                                    end
                                                                    
                                                                    code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 3.35e+184], N[(i * y), $MachinePrecision], N[(N[(a / i), $MachinePrecision] * i), $MachinePrecision]]
                                                                    
                                                                    \begin{array}{l}
                                                                    
                                                                    \\
                                                                    \begin{array}{l}
                                                                    \mathbf{if}\;a \leq 3.35 \cdot 10^{+184}:\\
                                                                    \;\;\;\;i \cdot y\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;\frac{a}{i} \cdot i\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 2 regimes
                                                                    2. if a < 3.35e184

                                                                      1. Initial program 99.9%

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

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

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

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

                                                                      if 3.35e184 < a

                                                                      1. Initial program 100.0%

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

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

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

                                                                        \[\leadsto \frac{a}{i} \cdot i \]
                                                                      6. Step-by-step derivation
                                                                        1. Applied rewrites32.4%

                                                                          \[\leadsto \frac{a}{i} \cdot i \]
                                                                      7. Recombined 2 regimes into one program.
                                                                      8. Add Preprocessing

                                                                      Alternative 15: 24.6% accurate, 39.0× speedup?

                                                                      \[\begin{array}{l} \\ i \cdot y \end{array} \]
                                                                      (FPCore (x y z t a b c i) :precision binary64 (* i y))
                                                                      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                      	return i * y;
                                                                      }
                                                                      
                                                                      module fmin_fmax_functions
                                                                          implicit none
                                                                          private
                                                                          public fmax
                                                                          public fmin
                                                                      
                                                                          interface fmax
                                                                              module procedure fmax88
                                                                              module procedure fmax44
                                                                              module procedure fmax84
                                                                              module procedure fmax48
                                                                          end interface
                                                                          interface fmin
                                                                              module procedure fmin88
                                                                              module procedure fmin44
                                                                              module procedure fmin84
                                                                              module procedure fmin48
                                                                          end interface
                                                                      contains
                                                                          real(8) function fmax88(x, y) result (res)
                                                                              real(8), intent (in) :: x
                                                                              real(8), intent (in) :: y
                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                          end function
                                                                          real(4) function fmax44(x, y) result (res)
                                                                              real(4), intent (in) :: x
                                                                              real(4), intent (in) :: y
                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                          end function
                                                                          real(8) function fmax84(x, y) result(res)
                                                                              real(8), intent (in) :: x
                                                                              real(4), intent (in) :: y
                                                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                          end function
                                                                          real(8) function fmax48(x, y) result(res)
                                                                              real(4), intent (in) :: x
                                                                              real(8), intent (in) :: y
                                                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                          end function
                                                                          real(8) function fmin88(x, y) result (res)
                                                                              real(8), intent (in) :: x
                                                                              real(8), intent (in) :: y
                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                          end function
                                                                          real(4) function fmin44(x, y) result (res)
                                                                              real(4), intent (in) :: x
                                                                              real(4), intent (in) :: y
                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                          end function
                                                                          real(8) function fmin84(x, y) result(res)
                                                                              real(8), intent (in) :: x
                                                                              real(4), intent (in) :: y
                                                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                          end function
                                                                          real(8) function fmin48(x, y) result(res)
                                                                              real(4), intent (in) :: x
                                                                              real(8), intent (in) :: y
                                                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                          end function
                                                                      end module
                                                                      
                                                                      real(8) function code(x, y, z, t, a, b, c, i)
                                                                      use fmin_fmax_functions
                                                                          real(8), intent (in) :: x
                                                                          real(8), intent (in) :: y
                                                                          real(8), intent (in) :: z
                                                                          real(8), intent (in) :: t
                                                                          real(8), intent (in) :: a
                                                                          real(8), intent (in) :: b
                                                                          real(8), intent (in) :: c
                                                                          real(8), intent (in) :: i
                                                                          code = i * y
                                                                      end function
                                                                      
                                                                      public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                      	return i * y;
                                                                      }
                                                                      
                                                                      def code(x, y, z, t, a, b, c, i):
                                                                      	return i * y
                                                                      
                                                                      function code(x, y, z, t, a, b, c, i)
                                                                      	return Float64(i * y)
                                                                      end
                                                                      
                                                                      function tmp = code(x, y, z, t, a, b, c, i)
                                                                      	tmp = i * y;
                                                                      end
                                                                      
                                                                      code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(i * y), $MachinePrecision]
                                                                      
                                                                      \begin{array}{l}
                                                                      
                                                                      \\
                                                                      i \cdot y
                                                                      \end{array}
                                                                      
                                                                      Derivation
                                                                      1. Initial program 99.9%

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

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

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

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

                                                                      Reproduce

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