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

Percentage Accurate: 99.8% → 99.8%
Time: 14.8s
Alternatives: 17
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

Alternative 2: 37.9% 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 -2 \cdot 10^{+66}:\\ \;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\ \mathbf{elif}\;t\_2 \leq 10^{+306}:\\ \;\;\;\;a + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;t\_1 + 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 -2e+66)
     (* i (+ y (/ z i)))
     (if (<= t_2 1e+306) (+ a (* b (log c))) (+ t_1 (* 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 <= -2e+66) {
		tmp = i * (y + (z / i));
	} else if (t_2 <= 1e+306) {
		tmp = a + (b * log(c));
	} else {
		tmp = t_1 + (y * i);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: 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 <= (-2d+66)) then
        tmp = i * (y + (z / i))
    else if (t_2 <= 1d+306) then
        tmp = a + (b * log(c))
    else
        tmp = t_1 + (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 <= -2e+66) {
		tmp = i * (y + (z / i));
	} else if (t_2 <= 1e+306) {
		tmp = a + (b * Math.log(c));
	} else {
		tmp = t_1 + (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 <= -2e+66:
		tmp = i * (y + (z / i))
	elif t_2 <= 1e+306:
		tmp = a + (b * math.log(c))
	else:
		tmp = t_1 + (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 <= -2e+66)
		tmp = Float64(i * Float64(y + Float64(z / i)));
	elseif (t_2 <= 1e+306)
		tmp = Float64(a + Float64(b * log(c)));
	else
		tmp = Float64(t_1 + 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 <= -2e+66)
		tmp = i * (y + (z / i));
	elseif (t_2 <= 1e+306)
		tmp = a + (b * log(c));
	else
		tmp = t_1 + (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, -2e+66], N[(i * N[(y + N[(z / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+306], N[(a + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + 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 -2 \cdot 10^{+66}:\\
\;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\

\mathbf{elif}\;t\_2 \leq 10^{+306}:\\
\;\;\;\;a + b \cdot \log c\\

\mathbf{else}:\\
\;\;\;\;t\_1 + 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)) < -1.99999999999999989e66

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto i \cdot \left(y + \color{blue}{\frac{z}{i}}\right) \]
    7. Step-by-step derivation
      1. lower-/.f6433.0

        \[\leadsto i \cdot \left(y + \color{blue}{\frac{z}{i}}\right) \]
    8. Simplified33.0%

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

    if -1.99999999999999989e66 < (+.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.00000000000000002e306

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \color{blue}{\log c \cdot b} \]
      3. lower-log.f6428.3

        \[\leadsto a + \color{blue}{\log c} \cdot b \]
    8. Simplified28.3%

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

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

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
      2. lower-log.f6494.5

        \[\leadsto x \cdot \color{blue}{\log y} + y \cdot i \]
    5. Simplified94.5%

      \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
  3. Recombined 3 regimes into one program.
  4. Final simplification34.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -2 \cdot 10^{+66}:\\ \;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\ \mathbf{elif}\;\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 10^{+306}:\\ \;\;\;\;a + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y + y \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 38.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^{+66}:\\ \;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+306}:\\ \;\;\;\;a + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log c, b, y \cdot i\right)\\ \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+66)
     (* i (+ y (/ z i)))
     (if (<= t_1 1e+306) (+ a (* b (log c))) (fma (log c) b (* 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+66) {
		tmp = i * (y + (z / i));
	} else if (t_1 <= 1e+306) {
		tmp = a + (b * log(c));
	} else {
		tmp = fma(log(c), b, (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+66)
		tmp = Float64(i * Float64(y + Float64(z / i)));
	elseif (t_1 <= 1e+306)
		tmp = Float64(a + Float64(b * log(c)));
	else
		tmp = fma(log(c), b, 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+66], N[(i * N[(y + N[(z / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+306], N[(a + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Log[c], $MachinePrecision] * b + 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^{+66}:\\
\;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+306}:\\
\;\;\;\;a + b \cdot \log c\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log c, b, y \cdot i\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)) < -1.99999999999999989e66

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto i \cdot \left(y + \color{blue}{\frac{z}{i}}\right) \]
    7. Step-by-step derivation
      1. lower-/.f6433.0

        \[\leadsto i \cdot \left(y + \color{blue}{\frac{z}{i}}\right) \]
    8. Simplified33.0%

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

    if -1.99999999999999989e66 < (+.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.00000000000000002e306

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \color{blue}{\log c \cdot b} \]
      3. lower-log.f6428.3

        \[\leadsto a + \color{blue}{\log c} \cdot b \]
    8. Simplified28.3%

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

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

    1. Initial program 100.0%

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

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

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

        \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]
      3. lower-log.f6494.4

        \[\leadsto \color{blue}{\log c} \cdot b + y \cdot i \]
    5. Simplified94.4%

      \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]
    6. Step-by-step derivation
      1. lift-log.f64N/A

        \[\leadsto \color{blue}{\log c} \cdot b + y \cdot i \]
      2. lift-*.f64N/A

        \[\leadsto \log c \cdot b + \color{blue}{y \cdot i} \]
      3. lower-fma.f6494.4

        \[\leadsto \color{blue}{\mathsf{fma}\left(\log c, b, y \cdot i\right)} \]
    7. Applied egg-rr94.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log c, b, y \cdot i\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification34.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -2 \cdot 10^{+66}:\\ \;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\ \mathbf{elif}\;\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 10^{+306}:\\ \;\;\;\;a + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log c, b, y \cdot i\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 37.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^{+66}:\\ \;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+299}:\\ \;\;\;\;a + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;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+66)
     (* i (+ y (/ z i)))
     (if (<= t_1 1e+299) (+ a (* b (log c))) (+ 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+66) {
		tmp = i * (y + (z / i));
	} else if (t_1 <= 1e+299) {
		tmp = a + (b * log(c));
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
    if (t_1 <= (-2d+66)) then
        tmp = i * (y + (z / i))
    else if (t_1 <= 1d+299) then
        tmp = a + (b * log(c))
    else
        tmp = 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)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
	double tmp;
	if (t_1 <= -2e+66) {
		tmp = i * (y + (z / i));
	} else if (t_1 <= 1e+299) {
		tmp = a + (b * Math.log(c));
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
	tmp = 0
	if t_1 <= -2e+66:
		tmp = i * (y + (z / i))
	elif t_1 <= 1e+299:
		tmp = a + (b * math.log(c))
	else:
		tmp = 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+66)
		tmp = Float64(i * Float64(y + Float64(z / i)));
	elseif (t_1 <= 1e+299)
		tmp = Float64(a + Float64(b * log(c)));
	else
		tmp = Float64(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)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
	tmp = 0.0;
	if (t_1 <= -2e+66)
		tmp = i * (y + (z / i));
	elseif (t_1 <= 1e+299)
		tmp = a + (b * log(c));
	else
		tmp = a + (y * i);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+66], N[(i * N[(y + N[(z / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+299], N[(a + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + 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^{+66}:\\
\;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+299}:\\
\;\;\;\;a + b \cdot \log c\\

\mathbf{else}:\\
\;\;\;\;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)) < -1.99999999999999989e66

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto i \cdot \left(y + \color{blue}{\frac{z}{i}}\right) \]
    7. Step-by-step derivation
      1. lower-/.f6433.0

        \[\leadsto i \cdot \left(y + \color{blue}{\frac{z}{i}}\right) \]
    8. Simplified33.0%

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

    if -1.99999999999999989e66 < (+.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.0000000000000001e299

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \color{blue}{\log c \cdot b} \]
      3. lower-log.f6428.1

        \[\leadsto a + \color{blue}{\log c} \cdot b \]
    8. Simplified28.1%

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

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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \color{blue}{i \cdot y} \]
    8. Simplified80.8%

      \[\leadsto a + \color{blue}{i \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification34.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -2 \cdot 10^{+66}:\\ \;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\ \mathbf{elif}\;\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 10^{+299}:\\ \;\;\;\;a + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 30.6% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;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)) < -5.00000000000000009e305

    1. Initial program 100.0%

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

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

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

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

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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto i \cdot \color{blue}{\frac{z}{i}} \]
    7. Step-by-step derivation
      1. lower-/.f6414.0

        \[\leadsto i \cdot \color{blue}{\frac{z}{i}} \]
    8. Simplified14.0%

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

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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \color{blue}{i \cdot y} \]
    8. Simplified31.6%

      \[\leadsto a + \color{blue}{i \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification27.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -5 \cdot 10^{+305}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -50:\\ \;\;\;\;i \cdot \frac{z}{i}\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 26.3% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 10^{+306}:\\
\;\;\;\;a\\

\mathbf{else}:\\
\;\;\;\;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)) < -50 or 1.00000000000000002e306 < (+.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. Add Preprocessing
    3. Taylor expanded in y around inf

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

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

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

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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto i \cdot \color{blue}{\frac{a}{i}} \]
    7. Step-by-step derivation
      1. lower-/.f648.7

        \[\leadsto i \cdot \color{blue}{\frac{a}{i}} \]
    8. Simplified8.7%

      \[\leadsto i \cdot \color{blue}{\frac{a}{i}} \]
    9. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto i \cdot \color{blue}{\frac{a}{i}} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{a}{i} \cdot i} \]
      3. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{a}{i}} \cdot i \]
      4. div-invN/A

        \[\leadsto \color{blue}{\left(a \cdot \frac{1}{i}\right)} \cdot i \]
      5. associate-*l*N/A

        \[\leadsto \color{blue}{a \cdot \left(\frac{1}{i} \cdot i\right)} \]
      6. inv-powN/A

        \[\leadsto a \cdot \left(\color{blue}{{i}^{-1}} \cdot i\right) \]
      7. pow-plusN/A

        \[\leadsto a \cdot \color{blue}{{i}^{\left(-1 + 1\right)}} \]
      8. metadata-evalN/A

        \[\leadsto a \cdot {i}^{\color{blue}{0}} \]
      9. metadata-evalN/A

        \[\leadsto a \cdot \color{blue}{1} \]
      10. metadata-evalN/A

        \[\leadsto a \cdot \color{blue}{\left(-1 \cdot -1\right)} \]
      11. lower-*.f64N/A

        \[\leadsto \color{blue}{a \cdot \left(-1 \cdot -1\right)} \]
      12. metadata-eval14.9

        \[\leadsto a \cdot \color{blue}{1} \]
    10. Applied egg-rr14.9%

      \[\leadsto \color{blue}{a \cdot 1} \]
    11. Step-by-step derivation
      1. *-rgt-identity14.9

        \[\leadsto \color{blue}{a} \]
    12. Applied egg-rr14.9%

      \[\leadsto \color{blue}{a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification22.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -50:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;\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 10^{+306}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;y \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 35.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -50:\\ \;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\ \mathbf{else}:\\ \;\;\;\;a + 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))
      -50.0)
   (* i (+ y (/ z i)))
   (+ a (* 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)) <= -50.0) {
		tmp = i * (y + (z / i));
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)) <= (-50.0d0)) then
        tmp = i * (y + (z / i))
    else
        tmp = 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 tmp;
	if (((((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i)) <= -50.0) {
		tmp = i * (y + (z / i));
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if ((((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)) <= -50.0:
		tmp = i * (y + (z / i))
	else:
		tmp = a + (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)) <= -50.0)
		tmp = Float64(i * Float64(y + Float64(z / i)));
	else
		tmp = Float64(a + Float64(y * i));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i)) <= -50.0)
		tmp = i * (y + (z / i));
	else
		tmp = a + (y * i);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], -50.0], N[(i * N[(y + N[(z / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + 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 -50:\\
\;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\

\mathbf{else}:\\
\;\;\;\;a + 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)) < -50

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto i \cdot \left(y + \color{blue}{\frac{z}{i}}\right) \]
    7. Step-by-step derivation
      1. lower-/.f6431.6

        \[\leadsto i \cdot \left(y + \color{blue}{\frac{z}{i}}\right) \]
    8. Simplified31.6%

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

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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \color{blue}{i \cdot y} \]
    8. Simplified31.6%

      \[\leadsto a + \color{blue}{i \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification31.6%

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

Alternative 8: 90.7% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.60000000000000004e135 or 5.39999999999999982e177 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z + \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\log c, \color{blue}{b + -0.5}, a\right)\right) \]
    11. Simplified83.4%

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

    if -5.60000000000000004e135 < x < 5.39999999999999982e177

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.6 \cdot 10^{+135}:\\ \;\;\;\;z + \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\log c, b + -0.5, a\right)\right)\\ \mathbf{elif}\;x \leq 5.4 \cdot 10^{+177}:\\ \;\;\;\;y \cdot i + \left(t + \left(a + \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;z + \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\log c, b + -0.5, a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 89.1% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.58000000000000007e165 or 1.9999999999999998e181 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(a, x \cdot \frac{\color{blue}{\log y}}{a}, a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    8. Simplified45.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, a\right)\right) \]
      9. sub-negN/A

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

        \[\leadsto \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\log c, b + \color{blue}{\frac{-1}{2}}, a\right)\right) \]
      11. lower-+.f6475.5

        \[\leadsto \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\log c, \color{blue}{b + -0.5}, a\right)\right) \]
    11. Simplified75.5%

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

    if -1.58000000000000007e165 < x < 1.9999999999999998e181

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.58 \cdot 10^{+165}:\\ \;\;\;\;\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\log c, b + -0.5, a\right)\right)\\ \mathbf{elif}\;x \leq 2 \cdot 10^{+181}:\\ \;\;\;\;y \cdot i + \left(t + \left(a + \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\log c, b + -0.5, a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 84.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 90.0% accurate, 1.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.95e169 or 5.99999999999999972e227 < x

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
      2. lower-log.f6477.1

        \[\leadsto x \cdot \color{blue}{\log y} + y \cdot i \]
    5. Simplified77.1%

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

    if -2.95e169 < x < 5.99999999999999972e227

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 90.0% accurate, 1.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.95e169 or 5.99999999999999972e227 < x

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
      2. lower-log.f6477.1

        \[\leadsto x \cdot \color{blue}{\log y} + y \cdot i \]
    5. Simplified77.1%

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

    if -2.95e169 < x < 5.99999999999999972e227

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 76.3% accurate, 1.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.95e169 or 5.99999999999999972e227 < x

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
      2. lower-log.f6477.1

        \[\leadsto x \cdot \color{blue}{\log y} + y \cdot i \]
    5. Simplified77.1%

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

    if -2.95e169 < x < 5.99999999999999972e227

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 70.2% accurate, 1.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.3000000000000002e163 or 3.49999999999999986e92 < x

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
      2. lower-log.f6469.9

        \[\leadsto x \cdot \color{blue}{\log y} + y \cdot i \]
    5. Simplified69.9%

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

    if -4.3000000000000002e163 < x < 3.49999999999999986e92

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \left(\mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z\right) + t\right) \]
      7. sub-negN/A

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

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

        \[\leadsto a + \left(\mathsf{fma}\left(\log c, \color{blue}{b + -0.5}, z\right) + t\right) \]
    8. Simplified78.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.3 \cdot 10^{+163}:\\ \;\;\;\;x \cdot \log y + y \cdot i\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{+92}:\\ \;\;\;\;a + \left(t + \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y + y \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 60.0% accurate, 1.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log c, b + -0.5, \mathsf{fma}\left(i, y, a\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.3000000000000001e122

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \left(\mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z\right) + t\right) \]
      7. sub-negN/A

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

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

        \[\leadsto a + \left(\mathsf{fma}\left(\log c, \color{blue}{b + -0.5}, z\right) + t\right) \]
    8. Simplified73.5%

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

    if -2.3000000000000001e122 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(a, x \cdot \frac{\color{blue}{\log y}}{a}, a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    8. Simplified60.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 38.3% accurate, 26.0× speedup?

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

\\
a + 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
  3. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto a + \color{blue}{i \cdot y} \]
  8. Simplified34.8%

    \[\leadsto a + \color{blue}{i \cdot y} \]
  9. Final simplification34.8%

    \[\leadsto a + y \cdot i \]
  10. Add Preprocessing

Alternative 17: 16.5% accurate, 234.0× speedup?

\[\begin{array}{l} \\ a \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return a;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    code = a
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return a;
}
def code(x, y, z, t, a, b, c, i):
	return a
function code(x, y, z, t, a, b, c, i)
	return a
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = a;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := a
\begin{array}{l}

\\
a
\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
  3. Taylor expanded in i around -inf

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

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

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

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

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

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

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

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

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

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

    \[\leadsto i \cdot \color{blue}{\frac{a}{i}} \]
  7. Step-by-step derivation
    1. lower-/.f6410.4

      \[\leadsto i \cdot \color{blue}{\frac{a}{i}} \]
  8. Simplified10.4%

    \[\leadsto i \cdot \color{blue}{\frac{a}{i}} \]
  9. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto i \cdot \color{blue}{\frac{a}{i}} \]
    2. *-commutativeN/A

      \[\leadsto \color{blue}{\frac{a}{i} \cdot i} \]
    3. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{a}{i}} \cdot i \]
    4. div-invN/A

      \[\leadsto \color{blue}{\left(a \cdot \frac{1}{i}\right)} \cdot i \]
    5. associate-*l*N/A

      \[\leadsto \color{blue}{a \cdot \left(\frac{1}{i} \cdot i\right)} \]
    6. inv-powN/A

      \[\leadsto a \cdot \left(\color{blue}{{i}^{-1}} \cdot i\right) \]
    7. pow-plusN/A

      \[\leadsto a \cdot \color{blue}{{i}^{\left(-1 + 1\right)}} \]
    8. metadata-evalN/A

      \[\leadsto a \cdot {i}^{\color{blue}{0}} \]
    9. metadata-evalN/A

      \[\leadsto a \cdot \color{blue}{1} \]
    10. metadata-evalN/A

      \[\leadsto a \cdot \color{blue}{\left(-1 \cdot -1\right)} \]
    11. lower-*.f64N/A

      \[\leadsto \color{blue}{a \cdot \left(-1 \cdot -1\right)} \]
    12. metadata-eval16.2

      \[\leadsto a \cdot \color{blue}{1} \]
  10. Applied egg-rr16.2%

    \[\leadsto \color{blue}{a \cdot 1} \]
  11. Step-by-step derivation
    1. *-rgt-identity16.2

      \[\leadsto \color{blue}{a} \]
  12. Applied egg-rr16.2%

    \[\leadsto \color{blue}{a} \]
  13. Add Preprocessing

Reproduce

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