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

Percentage Accurate: 99.8% → 99.8%
Time: 15.6s
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} \\ a + \left(t + \left(z + \left(\log \left(\frac{1}{c}\right) \cdot \left(0.5 - b\right) + \left(x \cdot \log y + i \cdot y\right)\right)\right)\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ a (+ t (+ z (+ (* (log (/ 1.0 c)) (- 0.5 b)) (+ (* x (log y)) (* i y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return a + (t + (z + ((log((1.0 / c)) * (0.5 - b)) + ((x * log(y)) + (i * y)))));
}
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 + (t + (z + ((log((1.0d0 / c)) * (0.5d0 - b)) + ((x * log(y)) + (i * y)))))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return a + (t + (z + ((Math.log((1.0 / c)) * (0.5 - b)) + ((x * Math.log(y)) + (i * y)))));
}
def code(x, y, z, t, a, b, c, i):
	return a + (t + (z + ((math.log((1.0 / c)) * (0.5 - b)) + ((x * math.log(y)) + (i * y)))))
function code(x, y, z, t, a, b, c, i)
	return Float64(a + Float64(t + Float64(z + Float64(Float64(log(Float64(1.0 / c)) * Float64(0.5 - b)) + Float64(Float64(x * log(y)) + Float64(i * y))))))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = a + (t + (z + ((log((1.0 / c)) * (0.5 - b)) + ((x * log(y)) + (i * y)))));
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a + N[(t + N[(z + N[(N[(N[Log[N[(1.0 / c), $MachinePrecision]], $MachinePrecision] * N[(0.5 - b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Step-by-step derivation
    1. associate-+l+99.8%

      \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
    2. associate-+l+99.8%

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 3: 98.0% accurate, 1.0× speedup?

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

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

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Step-by-step derivation
    1. associate-+l+99.8%

      \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
    2. associate-+l+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto a + \left(t + \left(z + \left(\color{blue}{\log c \cdot b} + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
  9. Final simplification98.1%

    \[\leadsto a + \left(t + \left(z + \left(\left(x \cdot \log y + i \cdot y\right) + b \cdot \log c\right)\right)\right) \]
  10. Add Preprocessing

Alternative 4: 88.4% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b - 0.5 \leq -5 \cdot 10^{+111} \lor \neg \left(b - 0.5 \leq 2.2 \cdot 10^{+186}\right):\\ \;\;\;\;z + \left(i \cdot y + \log c \cdot \left(b + -0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + i \cdot y\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= (- b 0.5) -5e+111) (not (<= (- b 0.5) 2.2e+186)))
   (+ z (+ (* i y) (* (log c) (+ b -0.5))))
   (+ a (+ t (+ z (+ (* x (log y)) (* i y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((b - 0.5) <= -5e+111) || !((b - 0.5) <= 2.2e+186)) {
		tmp = z + ((i * y) + (log(c) * (b + -0.5)));
	} else {
		tmp = a + (t + (z + ((x * log(y)) + (i * y))));
	}
	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 (((b - 0.5d0) <= (-5d+111)) .or. (.not. ((b - 0.5d0) <= 2.2d+186))) then
        tmp = z + ((i * y) + (log(c) * (b + (-0.5d0))))
    else
        tmp = a + (t + (z + ((x * log(y)) + (i * y))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((b - 0.5) <= -5e+111) || !((b - 0.5) <= 2.2e+186)) {
		tmp = z + ((i * y) + (Math.log(c) * (b + -0.5)));
	} else {
		tmp = a + (t + (z + ((x * Math.log(y)) + (i * y))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if ((b - 0.5) <= -5e+111) or not ((b - 0.5) <= 2.2e+186):
		tmp = z + ((i * y) + (math.log(c) * (b + -0.5)))
	else:
		tmp = a + (t + (z + ((x * math.log(y)) + (i * y))))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((Float64(b - 0.5) <= -5e+111) || !(Float64(b - 0.5) <= 2.2e+186))
		tmp = Float64(z + Float64(Float64(i * y) + Float64(log(c) * Float64(b + -0.5))));
	else
		tmp = Float64(a + Float64(t + Float64(z + Float64(Float64(x * log(y)) + Float64(i * y)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (((b - 0.5) <= -5e+111) || ~(((b - 0.5) <= 2.2e+186)))
		tmp = z + ((i * y) + (log(c) * (b + -0.5)));
	else
		tmp = a + (t + (z + ((x * log(y)) + (i * y))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(b - 0.5), $MachinePrecision], -5e+111], N[Not[LessEqual[N[(b - 0.5), $MachinePrecision], 2.2e+186]], $MachinePrecision]], N[(z + N[(N[(i * y), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq -5 \cdot 10^{+111} \lor \neg \left(b - 0.5 \leq 2.2 \cdot 10^{+186}\right):\\
\;\;\;\;z + \left(i \cdot y + \log c \cdot \left(b + -0.5\right)\right)\\

\mathbf{else}:\\
\;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + i \cdot y\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 b #s(literal 1/2 binary64)) < -4.9999999999999997e111 or 2.1999999999999998e186 < (-.f64 b #s(literal 1/2 binary64))

    1. Initial program 99.6%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.6%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.6%

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

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

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

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

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

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

    if -4.9999999999999997e111 < (-.f64 b #s(literal 1/2 binary64)) < 2.1999999999999998e186

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

      \[\leadsto a + \left(t + \left(z + \left(\color{blue}{-1 \cdot \left(b \cdot \log \left(\frac{1}{c}\right)\right)} + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. mul-1-neg97.6%

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

        \[\leadsto a + \left(t + \left(z + \left(\left(-\color{blue}{\log \left(\frac{1}{c}\right) \cdot b}\right) + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
      3. distribute-lft-neg-in97.6%

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

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

        \[\leadsto a + \left(t + \left(z + \left(\color{blue}{\log c} \cdot b + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    8. Simplified97.6%

      \[\leadsto a + \left(t + \left(z + \left(\color{blue}{\log c \cdot b} + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    9. Taylor expanded in b around 0 91.6%

      \[\leadsto a + \left(t + \left(z + \color{blue}{\left(i \cdot y + x \cdot \log y\right)}\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.0%

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

Alternative 5: 70.8% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;x \leq 3.9 \cdot 10^{-38}:\\
\;\;\;\;t\_1 + \left(a + \left(t + z\right)\right)\\

\mathbf{elif}\;x \leq 2.75 \cdot 10^{+109}:\\
\;\;\;\;z + \left(i \cdot y + t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.6999999999999999e71 or 2.7499999999999999e109 < x

    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. Step-by-step derivation
      1. associate-+l+99.7%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.7%

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

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

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

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

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

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

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

    if -1.6999999999999999e71 < x < 3.8999999999999999e-38

    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 99.6%

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

        \[\leadsto \color{blue}{\left(\left(a + t\right) + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)} + y \cdot i \]
      2. sub-neg99.6%

        \[\leadsto \left(\left(a + t\right) + \left(z + \log c \cdot \color{blue}{\left(b + \left(-0.5\right)\right)}\right)\right) + y \cdot i \]
      3. metadata-eval99.6%

        \[\leadsto \left(\left(a + t\right) + \left(z + \log c \cdot \left(b + \color{blue}{-0.5}\right)\right)\right) + y \cdot i \]
      4. +-commutative99.6%

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

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

      \[\leadsto \color{blue}{i \cdot \left(y + \left(\frac{a}{i} + \left(\frac{t}{i} + \left(\frac{z}{i} + \frac{\log c \cdot \left(b - 0.5\right)}{i}\right)\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-+r+68.0%

        \[\leadsto i \cdot \color{blue}{\left(\left(y + \frac{a}{i}\right) + \left(\frac{t}{i} + \left(\frac{z}{i} + \frac{\log c \cdot \left(b - 0.5\right)}{i}\right)\right)\right)} \]
      2. associate-+r+68.0%

        \[\leadsto i \cdot \left(\left(y + \frac{a}{i}\right) + \color{blue}{\left(\left(\frac{t}{i} + \frac{z}{i}\right) + \frac{\log c \cdot \left(b - 0.5\right)}{i}\right)}\right) \]
      3. sub-neg68.0%

        \[\leadsto i \cdot \left(\left(y + \frac{a}{i}\right) + \left(\left(\frac{t}{i} + \frac{z}{i}\right) + \frac{\log c \cdot \color{blue}{\left(b + \left(-0.5\right)\right)}}{i}\right)\right) \]
      4. metadata-eval68.0%

        \[\leadsto i \cdot \left(\left(y + \frac{a}{i}\right) + \left(\left(\frac{t}{i} + \frac{z}{i}\right) + \frac{\log c \cdot \left(b + \color{blue}{-0.5}\right)}{i}\right)\right) \]
      5. associate-/l*67.9%

        \[\leadsto i \cdot \left(\left(y + \frac{a}{i}\right) + \left(\left(\frac{t}{i} + \frac{z}{i}\right) + \color{blue}{\log c \cdot \frac{b + -0.5}{i}}\right)\right) \]
    8. Simplified67.9%

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

      \[\leadsto \color{blue}{a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)} \]
    10. Step-by-step derivation
      1. associate-+r+82.9%

        \[\leadsto a + \color{blue}{\left(\left(t + z\right) + \log c \cdot \left(b - 0.5\right)\right)} \]
      2. associate-+r+82.9%

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

        \[\leadsto \left(a + \color{blue}{\left(z + t\right)}\right) + \log c \cdot \left(b - 0.5\right) \]
      4. sub-neg82.9%

        \[\leadsto \left(a + \left(z + t\right)\right) + \log c \cdot \color{blue}{\left(b + \left(-0.5\right)\right)} \]
      5. metadata-eval82.9%

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

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

    if 3.8999999999999999e-38 < x < 2.7499999999999999e109

    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. Step-by-step derivation
      1. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.9%

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

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

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

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

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

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

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

Alternative 6: 95.0% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{+71} \lor \neg \left(x \leq 2.2 \cdot 10^{+109}\right):\\ \;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + i \cdot y\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;i \cdot y + \left(\left(a + t\right) + \left(z + \log c \cdot \left(b + -0.5\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= x -3.4e+71) (not (<= x 2.2e+109)))
   (+ a (+ t (+ z (+ (* x (log y)) (* i y)))))
   (+ (* i y) (+ (+ a t) (+ z (* (log c) (+ b -0.5)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x <= -3.4e+71) || !(x <= 2.2e+109)) {
		tmp = a + (t + (z + ((x * log(y)) + (i * y))));
	} else {
		tmp = (i * y) + ((a + t) + (z + (log(c) * (b + -0.5))));
	}
	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 <= (-3.4d+71)) .or. (.not. (x <= 2.2d+109))) then
        tmp = a + (t + (z + ((x * log(y)) + (i * y))))
    else
        tmp = (i * y) + ((a + t) + (z + (log(c) * (b + (-0.5d0)))))
    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 <= -3.4e+71) || !(x <= 2.2e+109)) {
		tmp = a + (t + (z + ((x * Math.log(y)) + (i * y))));
	} else {
		tmp = (i * y) + ((a + t) + (z + (Math.log(c) * (b + -0.5))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (x <= -3.4e+71) or not (x <= 2.2e+109):
		tmp = a + (t + (z + ((x * math.log(y)) + (i * y))))
	else:
		tmp = (i * y) + ((a + t) + (z + (math.log(c) * (b + -0.5))))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((x <= -3.4e+71) || !(x <= 2.2e+109))
		tmp = Float64(a + Float64(t + Float64(z + Float64(Float64(x * log(y)) + Float64(i * y)))));
	else
		tmp = Float64(Float64(i * y) + Float64(Float64(a + t) + Float64(z + Float64(log(c) * Float64(b + -0.5)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((x <= -3.4e+71) || ~((x <= 2.2e+109)))
		tmp = a + (t + (z + ((x * log(y)) + (i * y))));
	else
		tmp = (i * y) + ((a + t) + (z + (log(c) * (b + -0.5))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -3.4e+71], N[Not[LessEqual[x, 2.2e+109]], $MachinePrecision]], N[(a + N[(t + N[(z + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(N[(a + t), $MachinePrecision] + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{+71} \lor \neg \left(x \leq 2.2 \cdot 10^{+109}\right):\\
\;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + i \cdot y\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;i \cdot y + \left(\left(a + t\right) + \left(z + \log c \cdot \left(b + -0.5\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.3999999999999998e71 or 2.1999999999999999e109 < x

    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. Step-by-step derivation
      1. associate-+l+99.7%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.7%

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

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

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

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

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

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

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

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

        \[\leadsto a + \left(t + \left(z + \left(\left(-\color{blue}{\log \left(\frac{1}{c}\right) \cdot b}\right) + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
      3. distribute-lft-neg-in99.7%

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

        \[\leadsto a + \left(t + \left(z + \left(\left(-\color{blue}{\left(-\log c\right)}\right) \cdot b + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
      5. remove-double-neg99.7%

        \[\leadsto a + \left(t + \left(z + \left(\color{blue}{\log c} \cdot b + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    8. Simplified99.7%

      \[\leadsto a + \left(t + \left(z + \left(\color{blue}{\log c \cdot b} + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    9. Taylor expanded in b around 0 91.6%

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

    if -3.3999999999999998e71 < x < 2.1999999999999999e109

    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 98.5%

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

        \[\leadsto \color{blue}{\left(\left(a + t\right) + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)} + y \cdot i \]
      2. sub-neg98.5%

        \[\leadsto \left(\left(a + t\right) + \left(z + \log c \cdot \color{blue}{\left(b + \left(-0.5\right)\right)}\right)\right) + y \cdot i \]
      3. metadata-eval98.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{+71} \lor \neg \left(x \leq 2.2 \cdot 10^{+109}\right):\\ \;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + i \cdot y\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;i \cdot y + \left(\left(a + t\right) + \left(z + \log c \cdot \left(b + -0.5\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 72.6% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := i \cdot y + \left(b - 0.5\right) \cdot \log c\\
\mathbf{if}\;b \leq -1.12 \cdot 10^{+177}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 9 \cdot 10^{-126}:\\
\;\;\;\;a + \left(t + \left(z + i \cdot y\right)\right)\\

\mathbf{elif}\;b \leq 2.15 \cdot 10^{+186}:\\
\;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.1200000000000001e177 or 2.15e186 < b

    1. Initial program 99.5%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.5%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.5%

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

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

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

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

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

      \[\leadsto \color{blue}{a} + \left(\left(b + -0.5\right) \cdot \log c + y \cdot i\right) \]
    6. Taylor expanded in a around 0 79.1%

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

    if -1.1200000000000001e177 < b < 9.0000000000000005e-126

    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. Step-by-step derivation
      1. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.9%

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

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

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

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

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

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

      \[\leadsto a + \left(t + \left(z + \left(\color{blue}{-1 \cdot \left(b \cdot \log \left(\frac{1}{c}\right)\right)} + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. mul-1-neg97.6%

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

        \[\leadsto a + \left(t + \left(z + \left(\left(-\color{blue}{\log \left(\frac{1}{c}\right) \cdot b}\right) + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
      3. distribute-lft-neg-in97.6%

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

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

        \[\leadsto a + \left(t + \left(z + \left(\color{blue}{\log c} \cdot b + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    8. Simplified97.6%

      \[\leadsto a + \left(t + \left(z + \left(\color{blue}{\log c \cdot b} + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    9. Taylor expanded in i around inf 77.4%

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

    if 9.0000000000000005e-126 < b < 2.15e186

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

      \[\leadsto a + \left(t + \left(z + \color{blue}{x \cdot \log y}\right)\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.5%

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

Alternative 8: 70.9% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b - 0.5 \leq -6.8 \cdot 10^{+175} \lor \neg \left(b - 0.5 \leq 1.65 \cdot 10^{+107}\right):\\ \;\;\;\;a + \left(b - 0.5\right) \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + i \cdot y\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= (- b 0.5) -6.8e+175) (not (<= (- b 0.5) 1.65e+107)))
   (+ a (* (- b 0.5) (log c)))
   (+ a (+ t (+ z (* i y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((b - 0.5) <= -6.8e+175) || !((b - 0.5) <= 1.65e+107)) {
		tmp = a + ((b - 0.5) * log(c));
	} else {
		tmp = a + (t + (z + (i * y)));
	}
	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 (((b - 0.5d0) <= (-6.8d+175)) .or. (.not. ((b - 0.5d0) <= 1.65d+107))) then
        tmp = a + ((b - 0.5d0) * log(c))
    else
        tmp = a + (t + (z + (i * y)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((b - 0.5) <= -6.8e+175) || !((b - 0.5) <= 1.65e+107)) {
		tmp = a + ((b - 0.5) * Math.log(c));
	} else {
		tmp = a + (t + (z + (i * y)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if ((b - 0.5) <= -6.8e+175) or not ((b - 0.5) <= 1.65e+107):
		tmp = a + ((b - 0.5) * math.log(c))
	else:
		tmp = a + (t + (z + (i * y)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((Float64(b - 0.5) <= -6.8e+175) || !(Float64(b - 0.5) <= 1.65e+107))
		tmp = Float64(a + Float64(Float64(b - 0.5) * log(c)));
	else
		tmp = Float64(a + Float64(t + Float64(z + Float64(i * y))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (((b - 0.5) <= -6.8e+175) || ~(((b - 0.5) <= 1.65e+107)))
		tmp = a + ((b - 0.5) * log(c));
	else
		tmp = a + (t + (z + (i * y)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(b - 0.5), $MachinePrecision], -6.8e+175], N[Not[LessEqual[N[(b - 0.5), $MachinePrecision], 1.65e+107]], $MachinePrecision]], N[(a + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq -6.8 \cdot 10^{+175} \lor \neg \left(b - 0.5 \leq 1.65 \cdot 10^{+107}\right):\\
\;\;\;\;a + \left(b - 0.5\right) \cdot \log c\\

\mathbf{else}:\\
\;\;\;\;a + \left(t + \left(z + i \cdot y\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 b #s(literal 1/2 binary64)) < -6.80000000000000056e175 or 1.65000000000000016e107 < (-.f64 b #s(literal 1/2 binary64))

    1. Initial program 99.6%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.6%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.6%

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

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

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

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

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

      \[\leadsto \color{blue}{a} + \left(\left(b + -0.5\right) \cdot \log c + y \cdot i\right) \]
    6. Taylor expanded in y around 0 60.7%

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

    if -6.80000000000000056e175 < (-.f64 b #s(literal 1/2 binary64)) < 1.65000000000000016e107

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \left(t + \left(z + \left(\left(-\color{blue}{\left(-\log c\right)}\right) \cdot b + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
      5. remove-double-neg97.5%

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

      \[\leadsto a + \left(t + \left(z + \left(\color{blue}{\log c \cdot b} + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    9. Taylor expanded in i around inf 74.7%

      \[\leadsto a + \left(t + \left(z + \color{blue}{i \cdot y}\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification70.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b - 0.5 \leq -6.8 \cdot 10^{+175} \lor \neg \left(b - 0.5 \leq 1.65 \cdot 10^{+107}\right):\\ \;\;\;\;a + \left(b - 0.5\right) \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + i \cdot y\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 59.8% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;z \leq -6.5 \cdot 10^{+63}:\\
\;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.7999999999999997e104

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

    if -9.7999999999999997e104 < z < -6.49999999999999992e63

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

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

    if -6.49999999999999992e63 < 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. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

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

Alternative 10: 61.5% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+138}:\\
\;\;\;\;a + \left(t + \left(z + i \cdot y\right)\right)\\

\mathbf{elif}\;z \leq -5 \cdot 10^{+63}:\\
\;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.10000000000000007e138

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

      \[\leadsto a + \left(t + \left(z + \left(\color{blue}{-1 \cdot \left(b \cdot \log \left(\frac{1}{c}\right)\right)} + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. mul-1-neg99.8%

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

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

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

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

        \[\leadsto a + \left(t + \left(z + \left(\color{blue}{\log c} \cdot b + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    8. Simplified99.8%

      \[\leadsto a + \left(t + \left(z + \left(\color{blue}{\log c \cdot b} + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    9. Taylor expanded in i around inf 80.3%

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

    if -2.10000000000000007e138 < z < -5.00000000000000011e63

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

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

    if -5.00000000000000011e63 < 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. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

      \[\leadsto \color{blue}{a} + \left(\left(b + -0.5\right) \cdot \log c + y \cdot i\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification61.9%

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

Alternative 11: 75.5% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.8 \cdot 10^{+71} \lor \neg \left(x \leq 2.15 \cdot 10^{+99}\right):\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + i \cdot y\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= x -2.8e+71) (not (<= x 2.15e+99)))
   (+ a (+ t (+ z (* x (log y)))))
   (+ a (+ t (+ z (* i y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x <= -2.8e+71) || !(x <= 2.15e+99)) {
		tmp = a + (t + (z + (x * log(y))));
	} else {
		tmp = a + (t + (z + (i * y)));
	}
	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 <= (-2.8d+71)) .or. (.not. (x <= 2.15d+99))) then
        tmp = a + (t + (z + (x * log(y))))
    else
        tmp = a + (t + (z + (i * y)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x <= -2.8e+71) || !(x <= 2.15e+99)) {
		tmp = a + (t + (z + (x * Math.log(y))));
	} else {
		tmp = a + (t + (z + (i * y)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (x <= -2.8e+71) or not (x <= 2.15e+99):
		tmp = a + (t + (z + (x * math.log(y))))
	else:
		tmp = a + (t + (z + (i * y)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((x <= -2.8e+71) || !(x <= 2.15e+99))
		tmp = Float64(a + Float64(t + Float64(z + Float64(x * log(y)))));
	else
		tmp = Float64(a + Float64(t + Float64(z + Float64(i * y))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((x <= -2.8e+71) || ~((x <= 2.15e+99)))
		tmp = a + (t + (z + (x * log(y))));
	else
		tmp = a + (t + (z + (i * y)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -2.8e+71], N[Not[LessEqual[x, 2.15e+99]], $MachinePrecision]], N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+71} \lor \neg \left(x \leq 2.15 \cdot 10^{+99}\right):\\
\;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\

\mathbf{else}:\\
\;\;\;\;a + \left(t + \left(z + i \cdot y\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.80000000000000002e71 or 2.1500000000000001e99 < x

    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. Step-by-step derivation
      1. associate-+l+99.7%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.7%

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

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

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

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

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

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

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

    if -2.80000000000000002e71 < x < 2.1500000000000001e99

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \left(t + \left(z + \left(\left(-\color{blue}{\left(-\log c\right)}\right) \cdot b + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
      5. remove-double-neg97.3%

        \[\leadsto a + \left(t + \left(z + \left(\color{blue}{\log c} \cdot b + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    8. Simplified97.3%

      \[\leadsto a + \left(t + \left(z + \left(\color{blue}{\log c \cdot b} + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    9. Taylor expanded in i around inf 72.8%

      \[\leadsto a + \left(t + \left(z + \color{blue}{i \cdot y}\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification73.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.8 \cdot 10^{+71} \lor \neg \left(x \leq 2.15 \cdot 10^{+99}\right):\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + i \cdot y\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 73.6% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{+109} \lor \neg \left(x \leq 6.5 \cdot 10^{+227}\right):\\ \;\;\;\;a + \left(t + x \cdot \log y\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + i \cdot y\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= x -4e+109) (not (<= x 6.5e+227)))
   (+ a (+ t (* x (log y))))
   (+ a (+ t (+ z (* i y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x <= -4e+109) || !(x <= 6.5e+227)) {
		tmp = a + (t + (x * log(y)));
	} else {
		tmp = a + (t + (z + (i * y)));
	}
	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 <= (-4d+109)) .or. (.not. (x <= 6.5d+227))) then
        tmp = a + (t + (x * log(y)))
    else
        tmp = a + (t + (z + (i * y)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x <= -4e+109) || !(x <= 6.5e+227)) {
		tmp = a + (t + (x * Math.log(y)));
	} else {
		tmp = a + (t + (z + (i * y)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (x <= -4e+109) or not (x <= 6.5e+227):
		tmp = a + (t + (x * math.log(y)))
	else:
		tmp = a + (t + (z + (i * y)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((x <= -4e+109) || !(x <= 6.5e+227))
		tmp = Float64(a + Float64(t + Float64(x * log(y))));
	else
		tmp = Float64(a + Float64(t + Float64(z + Float64(i * y))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((x <= -4e+109) || ~((x <= 6.5e+227)))
		tmp = a + (t + (x * log(y)));
	else
		tmp = a + (t + (z + (i * y)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -4e+109], N[Not[LessEqual[x, 6.5e+227]], $MachinePrecision]], N[(a + N[(t + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+109} \lor \neg \left(x \leq 6.5 \cdot 10^{+227}\right):\\
\;\;\;\;a + \left(t + x \cdot \log y\right)\\

\mathbf{else}:\\
\;\;\;\;a + \left(t + \left(z + i \cdot y\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.99999999999999993e109 or 6.50000000000000018e227 < x

    1. Initial program 99.6%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.6%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.6%

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

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

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

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

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

      \[\leadsto \color{blue}{a + \left(t + \left(z + \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - 0.5\right)\right) + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right)} \]
    6. Step-by-step derivation
      1. add-cbrt-cube99.5%

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

        \[\leadsto a + \left(t + \left(z + \left(-1 \cdot \left(\sqrt[3]{\color{blue}{{\log \left(\frac{1}{c}\right)}^{3}}} \cdot \left(b - 0.5\right)\right) + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
      3. log-rec99.6%

        \[\leadsto a + \left(t + \left(z + \left(-1 \cdot \left(\sqrt[3]{{\color{blue}{\left(-\log c\right)}}^{3}} \cdot \left(b - 0.5\right)\right) + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    7. Applied egg-rr99.6%

      \[\leadsto a + \left(t + \left(z + \left(-1 \cdot \left(\color{blue}{\sqrt[3]{{\left(-\log c\right)}^{3}}} \cdot \left(b - 0.5\right)\right) + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    8. Taylor expanded in x around inf 67.9%

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

    if -3.99999999999999993e109 < x < 6.50000000000000018e227

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

      \[\leadsto a + \left(t + \left(z + \left(\color{blue}{-1 \cdot \left(b \cdot \log \left(\frac{1}{c}\right)\right)} + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. mul-1-neg97.6%

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

        \[\leadsto a + \left(t + \left(z + \left(\left(-\color{blue}{\log \left(\frac{1}{c}\right) \cdot b}\right) + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
      3. distribute-lft-neg-in97.6%

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

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

        \[\leadsto a + \left(t + \left(z + \left(\color{blue}{\log c} \cdot b + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    8. Simplified97.6%

      \[\leadsto a + \left(t + \left(z + \left(\color{blue}{\log c \cdot b} + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    9. Taylor expanded in i around inf 71.4%

      \[\leadsto a + \left(t + \left(z + \color{blue}{i \cdot y}\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification70.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{+109} \lor \neg \left(x \leq 6.5 \cdot 10^{+227}\right):\\ \;\;\;\;a + \left(t + x \cdot \log y\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + i \cdot y\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 51.7% accurate, 14.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -1.36 \cdot 10^{+183} \lor \neg \left(i \leq 8 \cdot 10^{+133}\right):\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= i -1.36e+183) (not (<= i 8e+133))) (* i y) (+ a (+ t z))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((i <= -1.36e+183) || !(i <= 8e+133)) {
		tmp = i * y;
	} else {
		tmp = a + (t + z);
	}
	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 ((i <= (-1.36d+183)) .or. (.not. (i <= 8d+133))) then
        tmp = i * y
    else
        tmp = a + (t + z)
    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 ((i <= -1.36e+183) || !(i <= 8e+133)) {
		tmp = i * y;
	} else {
		tmp = a + (t + z);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (i <= -1.36e+183) or not (i <= 8e+133):
		tmp = i * y
	else:
		tmp = a + (t + z)
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((i <= -1.36e+183) || !(i <= 8e+133))
		tmp = Float64(i * y);
	else
		tmp = Float64(a + Float64(t + z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((i <= -1.36e+183) || ~((i <= 8e+133)))
		tmp = i * y;
	else
		tmp = a + (t + z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -1.36e+183], N[Not[LessEqual[i, 8e+133]], $MachinePrecision]], N[(i * y), $MachinePrecision], N[(a + N[(t + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq -1.36 \cdot 10^{+183} \lor \neg \left(i \leq 8 \cdot 10^{+133}\right):\\
\;\;\;\;i \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -1.35999999999999995e183 or 8.0000000000000002e133 < i

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

      \[\leadsto \color{blue}{i \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative58.5%

        \[\leadsto \color{blue}{y \cdot i} \]
    7. Simplified58.5%

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

    if -1.35999999999999995e183 < i < 8.0000000000000002e133

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

      \[\leadsto a + \left(t + \color{blue}{z}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification53.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -1.36 \cdot 10^{+183} \lor \neg \left(i \leq 8 \cdot 10^{+133}\right):\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 28.9% accurate, 16.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -8.8 \cdot 10^{+182} \lor \neg \left(i \leq 8.5 \cdot 10^{+29}\right):\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= i -8.8e+182) (not (<= i 8.5e+29))) (* i y) a))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((i <= -8.8e+182) || !(i <= 8.5e+29)) {
		tmp = i * y;
	} else {
		tmp = a;
	}
	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 ((i <= (-8.8d+182)) .or. (.not. (i <= 8.5d+29))) then
        tmp = i * y
    else
        tmp = a
    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 ((i <= -8.8e+182) || !(i <= 8.5e+29)) {
		tmp = i * y;
	} else {
		tmp = a;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (i <= -8.8e+182) or not (i <= 8.5e+29):
		tmp = i * y
	else:
		tmp = a
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((i <= -8.8e+182) || !(i <= 8.5e+29))
		tmp = Float64(i * y);
	else
		tmp = a;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((i <= -8.8e+182) || ~((i <= 8.5e+29)))
		tmp = i * y;
	else
		tmp = a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -8.8e+182], N[Not[LessEqual[i, 8.5e+29]], $MachinePrecision]], N[(i * y), $MachinePrecision], a]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq -8.8 \cdot 10^{+182} \lor \neg \left(i \leq 8.5 \cdot 10^{+29}\right):\\
\;\;\;\;i \cdot y\\

\mathbf{else}:\\
\;\;\;\;a\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -8.79999999999999986e182 or 8.5000000000000006e29 < i

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot i} \]
    7. Simplified51.4%

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

    if -8.79999999999999986e182 < i < 8.5000000000000006e29

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -8.8 \cdot 10^{+182} \lor \neg \left(i \leq 8.5 \cdot 10^{+29}\right):\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 56.9% accurate, 18.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+149}:\\
\;\;\;\;a + \left(t + z\right)\\

\mathbf{else}:\\
\;\;\;\;a + \left(t + i \cdot y\right)\\


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

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

      \[\leadsto a + \left(t + \color{blue}{z}\right) \]

    if -1.24999999999999998e149 < 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. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

      \[\leadsto \color{blue}{a + \left(t + \left(z + \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - 0.5\right)\right) + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right)} \]
    6. Step-by-step derivation
      1. add-cbrt-cube99.7%

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

        \[\leadsto a + \left(t + \left(z + \left(-1 \cdot \left(\sqrt[3]{\color{blue}{{\log \left(\frac{1}{c}\right)}^{3}}} \cdot \left(b - 0.5\right)\right) + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
      3. log-rec99.7%

        \[\leadsto a + \left(t + \left(z + \left(-1 \cdot \left(\sqrt[3]{{\color{blue}{\left(-\log c\right)}}^{3}} \cdot \left(b - 0.5\right)\right) + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    7. Applied egg-rr99.7%

      \[\leadsto a + \left(t + \left(z + \left(-1 \cdot \left(\color{blue}{\sqrt[3]{{\left(-\log c\right)}^{3}}} \cdot \left(b - 0.5\right)\right) + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
    8. Taylor expanded in i around inf 50.6%

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

Alternative 16: 67.7% accurate, 24.3× speedup?

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

\\
a + \left(t + \left(z + i \cdot y\right)\right)
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Step-by-step derivation
    1. associate-+l+99.8%

      \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
    2. associate-+l+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto a + \left(t + \left(z + \left(\color{blue}{\log c \cdot b} + \left(i \cdot y + x \cdot \log y\right)\right)\right)\right) \]
  9. Taylor expanded in i around inf 62.1%

    \[\leadsto a + \left(t + \left(z + \color{blue}{i \cdot y}\right)\right) \]
  10. Add Preprocessing

Alternative 17: 16.4% accurate, 219.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. Step-by-step derivation
    1. associate-+l+99.8%

      \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
    2. associate-+l+99.8%

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

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

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

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

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

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

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

Reproduce

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