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

Percentage Accurate: 99.8% → 99.8%
Time: 6.7s
Alternatives: 19
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}

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 19 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.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

Alternative 2: 90.6% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;a + \left(t + t\_1\right)\\


\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)) < -2e14

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.8%

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

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

        \[\leadsto a + \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)} \]
      2. lower-+.f64N/A

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

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

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

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

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

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

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

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

Alternative 3: 90.2% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{+56}:\\
\;\;\;\;t + \left(z + t\_2\right)\\

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


\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)) < -9.99999999999999986e306

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in 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)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

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

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

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

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

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

    if -9.99999999999999986e306 < (+.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)) < -5.00000000000000024e56

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.8%

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

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

        \[\leadsto a + \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)} \]
      2. lower-+.f64N/A

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

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

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

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

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

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

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

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

Alternative 4: 90.1% accurate, 1.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t + \left(z + t\_2\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.3599999999999999e129

    1. Initial program 99.8%

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

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

        \[\leadsto a + \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)} \]
      2. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3599999999999999e129 < x < 1.25000000000000002e140

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in 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)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

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

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

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

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

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

    if 1.25000000000000002e140 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 84.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;x \leq -1.1 \cdot 10^{+221}:\\
\;\;\;\;\frac{1}{\frac{1}{x \cdot \log y}} + y \cdot i\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.1e221

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{x \cdot \log y}}} + y \cdot i \]
    9. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \frac{1}{\frac{1}{x \cdot \color{blue}{\log y}}} + y \cdot i \]
      3. lower-log.f6439.1

        \[\leadsto \frac{1}{\frac{1}{x \cdot \log y}} + y \cdot i \]
    10. Applied rewrites39.1%

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{x \cdot \log y}}} + y \cdot i \]

    if -1.1e221 < x < 1.25000000000000002e140

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in 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)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

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

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

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

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

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

    if 1.25000000000000002e140 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 79.5% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{1}{\frac{1}{x \cdot \log y}} + y \cdot i\\
\mathbf{if}\;x \leq -1.1 \cdot 10^{+221}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.1e221 or 4.19999999999999976e219 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{x \cdot \log y}}} + y \cdot i \]
    9. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \frac{1}{\frac{1}{x \cdot \color{blue}{\log y}}} + y \cdot i \]
      3. lower-log.f6439.1

        \[\leadsto \frac{1}{\frac{1}{x \cdot \log y}} + y \cdot i \]
    10. Applied rewrites39.1%

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{x \cdot \log y}}} + y \cdot i \]

    if -1.1e221 < x < 4.19999999999999976e219

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in 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)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

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

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

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

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

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

Alternative 7: 70.0% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
t_2 := x \cdot \log y\\
t_3 := \left(\left(\left(\left(t\_2 + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{+303}:\\
\;\;\;\;\frac{t \cdot t\_2}{t} + y \cdot i\\

\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{+56}:\\
\;\;\;\;a + \left(t + \left(z + t\_1\right)\right)\\

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


\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)) < -4.9999999999999997e303

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{t \cdot \left(x \cdot \log y\right)}}{t} + y \cdot i \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto \frac{t \cdot \left(x \cdot \color{blue}{\log y}\right)}{t} + y \cdot i \]
      3. lower-log.f6434.7

        \[\leadsto \frac{t \cdot \left(x \cdot \log y\right)}{t} + y \cdot i \]
    8. Applied rewrites34.7%

      \[\leadsto \frac{\color{blue}{t \cdot \left(x \cdot \log y\right)}}{t} + y \cdot i \]

    if -4.9999999999999997e303 < (+.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)) < -5.00000000000000024e56

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in 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)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \left(t + \left(z + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
      5. lower--.f6461.2

        \[\leadsto a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right) \]
    7. Applied rewrites61.2%

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

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

    1. Initial program 99.8%

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

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

        \[\leadsto a + \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)} \]
      2. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 68.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := \left(\left(\left(\left(t\_1 + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+303}:\\ \;\;\;\;\frac{t \cdot t\_1}{t} + y \cdot i\\ \mathbf{elif}\;t\_2 \leq 10^{+283}:\\ \;\;\;\;a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{1}{a}} + y \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* x (log y)))
        (t_2 (+ (+ (+ (+ (+ t_1 z) t) a) (* (- b 0.5) (log c))) (* y i))))
   (if (<= t_2 -5e+303)
     (+ (/ (* t t_1) t) (* y i))
     (if (<= t_2 1e+283)
       (+ a (+ t (+ z (* (log c) (- b 0.5)))))
       (+ (/ 1.0 (/ 1.0 a)) (* y 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);
	double t_2 = ((((t_1 + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
	double tmp;
	if (t_2 <= -5e+303) {
		tmp = ((t * t_1) / t) + (y * i);
	} else if (t_2 <= 1e+283) {
		tmp = a + (t + (z + (log(c) * (b - 0.5))));
	} else {
		tmp = (1.0 / (1.0 / a)) + (y * 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * log(y)
    t_2 = ((((t_1 + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
    if (t_2 <= (-5d+303)) then
        tmp = ((t * t_1) / t) + (y * i)
    else if (t_2 <= 1d+283) then
        tmp = a + (t + (z + (log(c) * (b - 0.5d0))))
    else
        tmp = (1.0d0 / (1.0d0 / a)) + (y * i)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = x * Math.log(y);
	double t_2 = ((((t_1 + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
	double tmp;
	if (t_2 <= -5e+303) {
		tmp = ((t * t_1) / t) + (y * i);
	} else if (t_2 <= 1e+283) {
		tmp = a + (t + (z + (Math.log(c) * (b - 0.5))));
	} else {
		tmp = (1.0 / (1.0 / a)) + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = x * math.log(y)
	t_2 = ((((t_1 + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
	tmp = 0
	if t_2 <= -5e+303:
		tmp = ((t * t_1) / t) + (y * i)
	elif t_2 <= 1e+283:
		tmp = a + (t + (z + (math.log(c) * (b - 0.5))))
	else:
		tmp = (1.0 / (1.0 / a)) + (y * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(x * log(y))
	t_2 = Float64(Float64(Float64(Float64(Float64(t_1 + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
	tmp = 0.0
	if (t_2 <= -5e+303)
		tmp = Float64(Float64(Float64(t * t_1) / t) + Float64(y * i));
	elseif (t_2 <= 1e+283)
		tmp = Float64(a + Float64(t + Float64(z + Float64(log(c) * Float64(b - 0.5)))));
	else
		tmp = Float64(Float64(1.0 / Float64(1.0 / a)) + Float64(y * i));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = x * log(y);
	t_2 = ((((t_1 + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
	tmp = 0.0;
	if (t_2 <= -5e+303)
		tmp = ((t * t_1) / t) + (y * i);
	elseif (t_2 <= 1e+283)
		tmp = a + (t + (z + (log(c) * (b - 0.5))));
	else
		tmp = (1.0 / (1.0 / a)) + (y * i);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(t$95$1 + 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$2, -5e+303], N[(N[(N[(t * t$95$1), $MachinePrecision] / t), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+283], N[(a + N[(t + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(1.0 / a), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \left(\left(\left(\left(t\_1 + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+303}:\\
\;\;\;\;\frac{t \cdot t\_1}{t} + y \cdot i\\

\mathbf{elif}\;t\_2 \leq 10^{+283}:\\
\;\;\;\;a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{a}} + y \cdot i\\


\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)) < -4.9999999999999997e303

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{t \cdot \left(x \cdot \log y\right)}}{t} + y \cdot i \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto \frac{t \cdot \left(x \cdot \color{blue}{\log y}\right)}{t} + y \cdot i \]
      3. lower-log.f6434.7

        \[\leadsto \frac{t \cdot \left(x \cdot \log y\right)}{t} + y \cdot i \]
    8. Applied rewrites34.7%

      \[\leadsto \frac{\color{blue}{t \cdot \left(x \cdot \log y\right)}}{t} + y \cdot i \]

    if -4.9999999999999997e303 < (+.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)) < 9.99999999999999955e282

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in 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)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \left(t + \left(z + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
      5. lower--.f6461.2

        \[\leadsto a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right) \]
    7. Applied rewrites61.2%

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

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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{a}}} + y \cdot i \]
    9. Step-by-step derivation
      1. lower-/.f6439.0

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{a}}} + y \cdot i \]
    10. Applied rewrites39.0%

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

Alternative 9: 68.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+303}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, t, i \cdot y\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+283}:\\ \;\;\;\;a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{1}{a}} + y \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 (<= t_1 -5e+303)
     (fma (/ z t) t (* i y))
     (if (<= t_1 1e+283)
       (+ a (+ t (+ z (* (log c) (- b 0.5)))))
       (+ (/ 1.0 (/ 1.0 a)) (* y 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 <= -5e+303) {
		tmp = fma((z / t), t, (i * y));
	} else if (t_1 <= 1e+283) {
		tmp = a + (t + (z + (log(c) * (b - 0.5))));
	} else {
		tmp = (1.0 / (1.0 / a)) + (y * 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 <= -5e+303)
		tmp = fma(Float64(z / t), t, Float64(i * y));
	elseif (t_1 <= 1e+283)
		tmp = Float64(a + Float64(t + Float64(z + Float64(log(c) * Float64(b - 0.5)))));
	else
		tmp = Float64(Float64(1.0 / Float64(1.0 / a)) + Float64(y * 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[LessEqual[t$95$1, -5e+303], N[(N[(z / t), $MachinePrecision] * t + N[(i * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+283], N[(a + N[(t + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(1.0 / a), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $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 -5 \cdot 10^{+303}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, t, i \cdot y\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+283}:\\
\;\;\;\;a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{a}} + y \cdot i\\


\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)) < -4.9999999999999997e303

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z}{t}} \cdot t + y \cdot i \]
    5. Step-by-step derivation
      1. lower-/.f6432.3

        \[\leadsto \frac{z}{\color{blue}{t}} \cdot t + y \cdot i \]
    6. Applied rewrites32.3%

      \[\leadsto \color{blue}{\frac{z}{t}} \cdot t + y \cdot i \]
    7. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t} \cdot t + y \cdot i} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t} \cdot t} + y \cdot i \]
      3. lower-fma.f6432.3

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{t}, t, y \cdot i\right)} \]
      4. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{y \cdot i}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{i \cdot y}\right) \]
      6. lower-*.f6432.3

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{i \cdot y}\right) \]
    8. Applied rewrites32.3%

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

    if -4.9999999999999997e303 < (+.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)) < 9.99999999999999955e282

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in 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)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \left(t + \left(z + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
      5. lower--.f6461.2

        \[\leadsto a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right) \]
    7. Applied rewrites61.2%

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

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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{a}}} + y \cdot i \]
    9. Step-by-step derivation
      1. lower-/.f6439.0

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{a}}} + y \cdot i \]
    10. Applied rewrites39.0%

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

Alternative 10: 55.4% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
t_2 := \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\_2 \leq -5 \cdot 10^{+303}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, t, i \cdot y\right)\\

\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+14}:\\
\;\;\;\;t + \left(z + t\_1\right)\\

\mathbf{elif}\;t\_2 \leq 10^{+283}:\\
\;\;\;\;a + \left(t + t\_1\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{a}} + y \cdot i\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 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)) < -4.9999999999999997e303

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z}{t}} \cdot t + y \cdot i \]
    5. Step-by-step derivation
      1. lower-/.f6432.3

        \[\leadsto \frac{z}{\color{blue}{t}} \cdot t + y \cdot i \]
    6. Applied rewrites32.3%

      \[\leadsto \color{blue}{\frac{z}{t}} \cdot t + y \cdot i \]
    7. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t} \cdot t + y \cdot i} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t} \cdot t} + y \cdot i \]
      3. lower-fma.f6432.3

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{t}, t, y \cdot i\right)} \]
      4. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{y \cdot i}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{i \cdot y}\right) \]
      6. lower-*.f6432.3

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{i \cdot y}\right) \]
    8. Applied rewrites32.3%

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

    if -4.9999999999999997e303 < (+.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)) < -2e14

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \left(z + \log c \cdot \left(b - \frac{1}{2}\right)\right) \]
      3. lower--.f6446.5

        \[\leadsto t + \left(z + \log c \cdot \left(b - 0.5\right)\right) \]
    10. Applied rewrites46.5%

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

    if -2e14 < (+.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)) < 9.99999999999999955e282

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in 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)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \left(t + \left(z + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
      5. lower--.f6461.2

        \[\leadsto a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right) \]
    7. Applied rewrites61.2%

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

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

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

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

        \[\leadsto a + \left(t + \log c \cdot \left(b - \frac{1}{2}\right)\right) \]
      4. lower--.f6446.4

        \[\leadsto a + \left(t + \log c \cdot \left(b - 0.5\right)\right) \]
    10. Applied rewrites46.4%

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

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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{a}}} + y \cdot i \]
    9. Step-by-step derivation
      1. lower-/.f6439.0

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{a}}} + y \cdot i \]
    10. Applied rewrites39.0%

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

Alternative 11: 47.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+303}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, t, i \cdot y\right)\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+14}:\\ \;\;\;\;t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{1}{a}} + y \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 (<= t_1 -5e+303)
     (fma (/ z t) t (* i y))
     (if (<= t_1 -2e+14)
       (+ t (+ z (* (log c) (- b 0.5))))
       (+ (/ 1.0 (/ 1.0 a)) (* y 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 <= -5e+303) {
		tmp = fma((z / t), t, (i * y));
	} else if (t_1 <= -2e+14) {
		tmp = t + (z + (log(c) * (b - 0.5)));
	} else {
		tmp = (1.0 / (1.0 / a)) + (y * 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 <= -5e+303)
		tmp = fma(Float64(z / t), t, Float64(i * y));
	elseif (t_1 <= -2e+14)
		tmp = Float64(t + Float64(z + Float64(log(c) * Float64(b - 0.5))));
	else
		tmp = Float64(Float64(1.0 / Float64(1.0 / a)) + Float64(y * 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[LessEqual[t$95$1, -5e+303], N[(N[(z / t), $MachinePrecision] * t + N[(i * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e+14], N[(t + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(1.0 / a), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $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 -5 \cdot 10^{+303}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, t, i \cdot y\right)\\

\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+14}:\\
\;\;\;\;t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{a}} + y \cdot i\\


\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)) < -4.9999999999999997e303

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z}{t}} \cdot t + y \cdot i \]
    5. Step-by-step derivation
      1. lower-/.f6432.3

        \[\leadsto \frac{z}{\color{blue}{t}} \cdot t + y \cdot i \]
    6. Applied rewrites32.3%

      \[\leadsto \color{blue}{\frac{z}{t}} \cdot t + y \cdot i \]
    7. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t} \cdot t + y \cdot i} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t} \cdot t} + y \cdot i \]
      3. lower-fma.f6432.3

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{t}, t, y \cdot i\right)} \]
      4. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{y \cdot i}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{i \cdot y}\right) \]
      6. lower-*.f6432.3

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{i \cdot y}\right) \]
    8. Applied rewrites32.3%

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

    if -4.9999999999999997e303 < (+.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)) < -2e14

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \left(z + \log c \cdot \left(b - \frac{1}{2}\right)\right) \]
      3. lower--.f6446.5

        \[\leadsto t + \left(z + \log c \cdot \left(b - 0.5\right)\right) \]
    10. Applied rewrites46.5%

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

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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{a}}} + y \cdot i \]
    9. Step-by-step derivation
      1. lower-/.f6439.0

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{a}}} + y \cdot i \]
    10. Applied rewrites39.0%

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

Alternative 12: 43.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+242}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, t, i \cdot y\right)\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+14}:\\ \;\;\;\;\frac{t \cdot z}{t} + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{1}{a}} + y \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 (<= t_1 -2e+242)
     (fma (/ z t) t (* i y))
     (if (<= t_1 -2e+14)
       (+ (/ (* t z) t) (* y i))
       (+ (/ 1.0 (/ 1.0 a)) (* y 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 <= -2e+242) {
		tmp = fma((z / t), t, (i * y));
	} else if (t_1 <= -2e+14) {
		tmp = ((t * z) / t) + (y * i);
	} else {
		tmp = (1.0 / (1.0 / a)) + (y * 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 <= -2e+242)
		tmp = fma(Float64(z / t), t, Float64(i * y));
	elseif (t_1 <= -2e+14)
		tmp = Float64(Float64(Float64(t * z) / t) + Float64(y * i));
	else
		tmp = Float64(Float64(1.0 / Float64(1.0 / a)) + Float64(y * 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[LessEqual[t$95$1, -2e+242], N[(N[(z / t), $MachinePrecision] * t + N[(i * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e+14], N[(N[(N[(t * z), $MachinePrecision] / t), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(1.0 / a), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $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^{+242}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, t, i \cdot y\right)\\

\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+14}:\\
\;\;\;\;\frac{t \cdot z}{t} + y \cdot i\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{a}} + y \cdot i\\


\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.0000000000000001e242

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z}{t}} \cdot t + y \cdot i \]
    5. Step-by-step derivation
      1. lower-/.f6432.3

        \[\leadsto \frac{z}{\color{blue}{t}} \cdot t + y \cdot i \]
    6. Applied rewrites32.3%

      \[\leadsto \color{blue}{\frac{z}{t}} \cdot t + y \cdot i \]
    7. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t} \cdot t + y \cdot i} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t} \cdot t} + y \cdot i \]
      3. lower-fma.f6432.3

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{t}, t, y \cdot i\right)} \]
      4. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{y \cdot i}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{i \cdot y}\right) \]
      6. lower-*.f6432.3

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{i \cdot y}\right) \]
    8. Applied rewrites32.3%

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

    if -2.0000000000000001e242 < (+.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)) < -2e14

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{t \cdot z}}{t} + y \cdot i \]
    7. Step-by-step derivation
      1. lower-*.f6434.3

        \[\leadsto \frac{t \cdot \color{blue}{z}}{t} + y \cdot i \]
    8. Applied rewrites34.3%

      \[\leadsto \frac{\color{blue}{t \cdot z}}{t} + y \cdot i \]

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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{a}}} + y \cdot i \]
    9. Step-by-step derivation
      1. lower-/.f6439.0

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{a}}} + y \cdot i \]
    10. Applied rewrites39.0%

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

Alternative 13: 41.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+242}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, t, i \cdot y\right)\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+14}:\\ \;\;\;\;\frac{t \cdot z}{t} + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;\frac{a \cdot t}{t} + y \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 (<= t_1 -2e+242)
     (fma (/ z t) t (* i y))
     (if (<= t_1 -2e+14)
       (+ (/ (* t z) t) (* y i))
       (+ (/ (* a t) t) (* y 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 <= -2e+242) {
		tmp = fma((z / t), t, (i * y));
	} else if (t_1 <= -2e+14) {
		tmp = ((t * z) / t) + (y * i);
	} else {
		tmp = ((a * t) / t) + (y * 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 <= -2e+242)
		tmp = fma(Float64(z / t), t, Float64(i * y));
	elseif (t_1 <= -2e+14)
		tmp = Float64(Float64(Float64(t * z) / t) + Float64(y * i));
	else
		tmp = Float64(Float64(Float64(a * t) / t) + Float64(y * 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[LessEqual[t$95$1, -2e+242], N[(N[(z / t), $MachinePrecision] * t + N[(i * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e+14], N[(N[(N[(t * z), $MachinePrecision] / t), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] / t), $MachinePrecision] + N[(y * i), $MachinePrecision]), $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^{+242}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, t, i \cdot y\right)\\

\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+14}:\\
\;\;\;\;\frac{t \cdot z}{t} + y \cdot i\\

\mathbf{else}:\\
\;\;\;\;\frac{a \cdot t}{t} + y \cdot i\\


\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.0000000000000001e242

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z}{t}} \cdot t + y \cdot i \]
    5. Step-by-step derivation
      1. lower-/.f6432.3

        \[\leadsto \frac{z}{\color{blue}{t}} \cdot t + y \cdot i \]
    6. Applied rewrites32.3%

      \[\leadsto \color{blue}{\frac{z}{t}} \cdot t + y \cdot i \]
    7. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t} \cdot t + y \cdot i} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t} \cdot t} + y \cdot i \]
      3. lower-fma.f6432.3

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{t}, t, y \cdot i\right)} \]
      4. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{y \cdot i}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{i \cdot y}\right) \]
      6. lower-*.f6432.3

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{i \cdot y}\right) \]
    8. Applied rewrites32.3%

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

    if -2.0000000000000001e242 < (+.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)) < -2e14

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{t \cdot z}}{t} + y \cdot i \]
    7. Step-by-step derivation
      1. lower-*.f6434.3

        \[\leadsto \frac{t \cdot \color{blue}{z}}{t} + y \cdot i \]
    8. Applied rewrites34.3%

      \[\leadsto \frac{\color{blue}{t \cdot z}}{t} + y \cdot i \]

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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{a \cdot t}}{t} + y \cdot i \]
    7. Step-by-step derivation
      1. lower-*.f6434.7

        \[\leadsto \frac{a \cdot \color{blue}{t}}{t} + y \cdot i \]
    8. Applied rewrites34.7%

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

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \frac{a \cdot t}{t}\right)\\


\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)) < -2e14

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z}{t}} \cdot t + y \cdot i \]
    5. Step-by-step derivation
      1. lower-/.f6432.3

        \[\leadsto \frac{z}{\color{blue}{t}} \cdot t + y \cdot i \]
    6. Applied rewrites32.3%

      \[\leadsto \color{blue}{\frac{z}{t}} \cdot t + y \cdot i \]
    7. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t} \cdot t + y \cdot i} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t} \cdot t} + y \cdot i \]
      3. lower-fma.f6432.3

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{t}, t, y \cdot i\right)} \]
      4. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{y \cdot i}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{i \cdot y}\right) \]
      6. lower-*.f6432.3

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{i \cdot y}\right) \]
    8. Applied rewrites32.3%

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

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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{a \cdot t}}{t} + y \cdot i \]
    7. Step-by-step derivation
      1. lower-*.f6434.7

        \[\leadsto \frac{a \cdot \color{blue}{t}}{t} + y \cdot i \]
    8. Applied rewrites34.7%

      \[\leadsto \frac{\color{blue}{a \cdot t}}{t} + y \cdot i \]
    9. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{a \cdot t}{t} + y \cdot i} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{a \cdot t}{t} + \color{blue}{y \cdot i} \]
      3. *-commutativeN/A

        \[\leadsto \frac{a \cdot t}{t} + \color{blue}{i \cdot y} \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{i \cdot y + \frac{a \cdot t}{t}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{y \cdot i} + \frac{a \cdot t}{t} \]
      6. lower-fma.f6434.7

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \frac{a \cdot t}{t}\right)} \]
    10. Applied rewrites34.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \frac{a \cdot t}{t}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

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

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

\mathbf{else}:\\
\;\;\;\;\frac{a \cdot t}{t} + y \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)) < -2e14

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z}{t}} \cdot t + y \cdot i \]
    5. Step-by-step derivation
      1. lower-/.f6432.3

        \[\leadsto \frac{z}{\color{blue}{t}} \cdot t + y \cdot i \]
    6. Applied rewrites32.3%

      \[\leadsto \color{blue}{\frac{z}{t}} \cdot t + y \cdot i \]
    7. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t} \cdot t + y \cdot i} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t} \cdot t} + y \cdot i \]
      3. lower-fma.f6432.3

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{t}, t, y \cdot i\right)} \]
      4. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{y \cdot i}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{i \cdot y}\right) \]
      6. lower-*.f6432.3

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, t, \color{blue}{i \cdot y}\right) \]
    8. Applied rewrites32.3%

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

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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{a \cdot t}}{t} + y \cdot i \]
    7. Step-by-step derivation
      1. lower-*.f6434.7

        \[\leadsto \frac{a \cdot \color{blue}{t}}{t} + y \cdot i \]
    8. Applied rewrites34.7%

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

Alternative 16: 34.7% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;x \leq 9 \cdot 10^{+139}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \frac{a \cdot t}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.80000000000000051e89 or 8.9999999999999999e139 < x

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in 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)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \log y \]
    7. Applied rewrites16.5%

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

    if -5.80000000000000051e89 < x < 8.9999999999999999e139

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{a \cdot t}}{t} + y \cdot i \]
    7. Step-by-step derivation
      1. lower-*.f6434.7

        \[\leadsto \frac{a \cdot \color{blue}{t}}{t} + y \cdot i \]
    8. Applied rewrites34.7%

      \[\leadsto \frac{\color{blue}{a \cdot t}}{t} + y \cdot i \]
    9. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{a \cdot t}{t} + y \cdot i} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{a \cdot t}{t} + \color{blue}{y \cdot i} \]
      3. *-commutativeN/A

        \[\leadsto \frac{a \cdot t}{t} + \color{blue}{i \cdot y} \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{i \cdot y + \frac{a \cdot t}{t}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{y \cdot i} + \frac{a \cdot t}{t} \]
      6. lower-fma.f6434.7

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \frac{a \cdot t}{t}\right)} \]
    10. Applied rewrites34.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \frac{a \cdot t}{t}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 34.5% accurate, 2.2× speedup?

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

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

\mathbf{elif}\;x \leq 1.16 \cdot 10^{+114}:\\
\;\;\;\;\mathsf{fma}\left(1, t, i \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.49999999999999976e89 or 1.15999999999999994e114 < x

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in 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)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \log y \]
    7. Applied rewrites16.5%

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

    if -5.49999999999999976e89 < x < 1.15999999999999994e114

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
    5. Step-by-step derivation
      1. Applied rewrites38.8%

        \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
      2. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{1 \cdot t + y \cdot i} \]
        2. lift-*.f64N/A

          \[\leadsto \color{blue}{1 \cdot t} + y \cdot i \]
        3. lower-fma.f6438.8

          \[\leadsto \color{blue}{\mathsf{fma}\left(1, t, y \cdot i\right)} \]
        4. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(1, t, \color{blue}{y \cdot i}\right) \]
        5. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(1, t, \color{blue}{i \cdot y}\right) \]
        6. lower-*.f6438.8

          \[\leadsto \mathsf{fma}\left(1, t, \color{blue}{i \cdot y}\right) \]
      3. Applied rewrites38.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1, t, i \cdot y\right)} \]
    6. Recombined 2 regimes into one program.
    7. Add Preprocessing

    Alternative 18: 34.0% accurate, 2.8× speedup?

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

      1. Initial program 99.8%

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

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

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

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

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

      if 4.20000000000000034e56 < y

      1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
      5. Step-by-step derivation
        1. Applied rewrites38.8%

          \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
        2. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{1 \cdot t + y \cdot i} \]
          2. lift-*.f64N/A

            \[\leadsto \color{blue}{1 \cdot t} + y \cdot i \]
          3. lower-fma.f6438.8

            \[\leadsto \color{blue}{\mathsf{fma}\left(1, t, y \cdot i\right)} \]
          4. lift-*.f64N/A

            \[\leadsto \mathsf{fma}\left(1, t, \color{blue}{y \cdot i}\right) \]
          5. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(1, t, \color{blue}{i \cdot y}\right) \]
          6. lower-*.f6438.8

            \[\leadsto \mathsf{fma}\left(1, t, \color{blue}{i \cdot y}\right) \]
        3. Applied rewrites38.8%

          \[\leadsto \color{blue}{\mathsf{fma}\left(1, t, i \cdot y\right)} \]
      6. Recombined 2 regimes into one program.
      7. Add Preprocessing

      Alternative 19: 34.0% accurate, 4.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
      5. Step-by-step derivation
        1. Applied rewrites38.8%

          \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
        2. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{1 \cdot t + y \cdot i} \]
          2. lift-*.f64N/A

            \[\leadsto \color{blue}{1 \cdot t} + y \cdot i \]
          3. lower-fma.f6438.8

            \[\leadsto \color{blue}{\mathsf{fma}\left(1, t, y \cdot i\right)} \]
          4. lift-*.f64N/A

            \[\leadsto \mathsf{fma}\left(1, t, \color{blue}{y \cdot i}\right) \]
          5. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(1, t, \color{blue}{i \cdot y}\right) \]
          6. lower-*.f6438.8

            \[\leadsto \mathsf{fma}\left(1, t, \color{blue}{i \cdot y}\right) \]
        3. Applied rewrites38.8%

          \[\leadsto \color{blue}{\mathsf{fma}\left(1, t, i \cdot y\right)} \]
        4. Add Preprocessing

        Reproduce

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