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

Percentage Accurate: 96.6% → 99.3%
Time: 23.2s
Alternatives: 16
Speedup: 1.5×

Specification

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

\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\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 16 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: 96.6% accurate, 1.0× speedup?

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

\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}

Alternative 1: 99.3% accurate, 1.5× speedup?

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

\\
x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot \left(z + b\right)}
\end{array}
Derivation
  1. Initial program 97.3%

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Taylor expanded in z around 0 100.0%

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{\left(-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)\right)}} \]
  3. Step-by-step derivation
    1. associate-*r*100.0%

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \left(\color{blue}{\left(-1 \cdot a\right) \cdot b} + -1 \cdot \left(a \cdot z\right)\right)} \]
    2. associate-*r*100.0%

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \left(\left(-1 \cdot a\right) \cdot b + \color{blue}{\left(-1 \cdot a\right) \cdot z}\right)} \]
    3. distribute-lft-out100.0%

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{\left(-1 \cdot a\right) \cdot \left(b + z\right)}} \]
    4. neg-mul-1100.0%

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{\left(-a\right)} \cdot \left(b + z\right)} \]
  4. Simplified100.0%

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{\left(-a\right) \cdot \left(b + z\right)}} \]
  5. Final simplification100.0%

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot \left(z + b\right)} \]

Alternative 2: 87.0% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{-11} \lor \neg \left(y \leq 1.35 \cdot 10^{+16}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\

\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.6500000000000001e-11 or 1.35e16 < y

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 94.4%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]

    if -1.6500000000000001e-11 < y < 1.35e16

    1. Initial program 94.1%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 84.8%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in z around 0 91.5%

      \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{-1 \cdot z} - b\right)} \]
    4. Step-by-step derivation
      1. neg-mul-191.5%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\left(-z\right)} - b\right)} \]
    5. Simplified91.5%

      \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\left(-z\right)} - b\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{-11} \lor \neg \left(y \leq 1.35 \cdot 10^{+16}\right):\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \end{array} \]

Alternative 3: 74.9% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.7 \cdot 10^{+21}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+22}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -3.7e+21)
   (* x (pow z y))
   (if (<= y 1.25e+22) (* x (exp (* (- a) (+ z b)))) (* x (exp (* y (- t)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -3.7e+21) {
		tmp = x * pow(z, y);
	} else if (y <= 1.25e+22) {
		tmp = x * exp((-a * (z + b)));
	} else {
		tmp = x * exp((y * -t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (y <= (-3.7d+21)) then
        tmp = x * (z ** y)
    else if (y <= 1.25d+22) then
        tmp = x * exp((-a * (z + b)))
    else
        tmp = x * exp((y * -t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -3.7e+21) {
		tmp = x * Math.pow(z, y);
	} else if (y <= 1.25e+22) {
		tmp = x * Math.exp((-a * (z + b)));
	} else {
		tmp = x * Math.exp((y * -t));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -3.7e+21:
		tmp = x * math.pow(z, y)
	elif y <= 1.25e+22:
		tmp = x * math.exp((-a * (z + b)))
	else:
		tmp = x * math.exp((y * -t))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -3.7e+21)
		tmp = Float64(x * (z ^ y));
	elseif (y <= 1.25e+22)
		tmp = Float64(x * exp(Float64(Float64(-a) * Float64(z + b))));
	else
		tmp = Float64(x * exp(Float64(y * Float64(-t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -3.7e+21)
		tmp = x * (z ^ y);
	elseif (y <= 1.25e+22)
		tmp = x * exp((-a * (z + b)));
	else
		tmp = x * exp((y * -t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.7e+21], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e+22], N[(x * N[Exp[N[((-a) * N[(z + b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.7 \cdot 10^{+21}:\\
\;\;\;\;x \cdot {z}^{y}\\

\mathbf{elif}\;y \leq 1.25 \cdot 10^{+22}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\

\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.7e21

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 92.1%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around 0 71.4%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \log z}} \]
    6. Taylor expanded in x around 0 71.4%

      \[\leadsto \color{blue}{x \cdot {z}^{y}} \]

    if -3.7e21 < y < 1.2499999999999999e22

    1. Initial program 94.6%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 82.2%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in z around 0 88.4%

      \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{-1 \cdot z} - b\right)} \]
    4. Step-by-step derivation
      1. neg-mul-188.4%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\left(-z\right)} - b\right)} \]
    5. Simplified88.4%

      \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\left(-z\right)} - b\right)} \]

    if 1.2499999999999999e22 < y

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 98.6%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around inf 74.4%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. mul-1-neg74.4%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out74.4%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative74.4%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    7. Simplified74.4%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification80.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.7 \cdot 10^{+21}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+22}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \end{array} \]

Alternative 4: 73.4% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{+23} \lor \neg \left(y \leq 1.35 \cdot 10^{+16}\right):\\
\;\;\;\;x \cdot {z}^{y}\\

\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.2e23 or 1.35e16 < y

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 94.9%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around 0 69.9%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \log z}} \]
    6. Taylor expanded in x around 0 69.9%

      \[\leadsto \color{blue}{x \cdot {z}^{y}} \]

    if -3.2e23 < y < 1.35e16

    1. Initial program 94.4%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 83.2%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in z around 0 79.2%

      \[\leadsto \color{blue}{x \cdot e^{-1 \cdot \left(a \cdot b\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg79.2%

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. *-commutative79.2%

        \[\leadsto x \cdot e^{-\color{blue}{b \cdot a}} \]
      3. distribute-rgt-neg-in79.2%

        \[\leadsto x \cdot e^{\color{blue}{b \cdot \left(-a\right)}} \]
    5. Simplified79.2%

      \[\leadsto \color{blue}{x \cdot e^{b \cdot \left(-a\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+23} \lor \neg \left(y \leq 1.35 \cdot 10^{+16}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot b}\\ \end{array} \]

Alternative 5: 71.7% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.45 \cdot 10^{+20}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{+21}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot b}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -1.45e+20)
   (* x (pow z y))
   (if (<= y 5.8e+21) (* x (exp (* (- a) b))) (* x (exp (* y (- t)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -1.45e+20) {
		tmp = x * pow(z, y);
	} else if (y <= 5.8e+21) {
		tmp = x * exp((-a * b));
	} else {
		tmp = x * exp((y * -t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (y <= (-1.45d+20)) then
        tmp = x * (z ** y)
    else if (y <= 5.8d+21) then
        tmp = x * exp((-a * b))
    else
        tmp = x * exp((y * -t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -1.45e+20) {
		tmp = x * Math.pow(z, y);
	} else if (y <= 5.8e+21) {
		tmp = x * Math.exp((-a * b));
	} else {
		tmp = x * Math.exp((y * -t));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -1.45e+20:
		tmp = x * math.pow(z, y)
	elif y <= 5.8e+21:
		tmp = x * math.exp((-a * b))
	else:
		tmp = x * math.exp((y * -t))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -1.45e+20)
		tmp = Float64(x * (z ^ y));
	elseif (y <= 5.8e+21)
		tmp = Float64(x * exp(Float64(Float64(-a) * b)));
	else
		tmp = Float64(x * exp(Float64(y * Float64(-t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -1.45e+20)
		tmp = x * (z ^ y);
	elseif (y <= 5.8e+21)
		tmp = x * exp((-a * b));
	else
		tmp = x * exp((y * -t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.45e+20], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e+21], N[(x * N[Exp[N[((-a) * b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+20}:\\
\;\;\;\;x \cdot {z}^{y}\\

\mathbf{elif}\;y \leq 5.8 \cdot 10^{+21}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot b}\\

\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.45e20

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 92.1%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around 0 71.4%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \log z}} \]
    6. Taylor expanded in x around 0 71.4%

      \[\leadsto \color{blue}{x \cdot {z}^{y}} \]

    if -1.45e20 < y < 5.8e21

    1. Initial program 94.6%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 82.2%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in z around 0 78.3%

      \[\leadsto \color{blue}{x \cdot e^{-1 \cdot \left(a \cdot b\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg78.3%

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. *-commutative78.3%

        \[\leadsto x \cdot e^{-\color{blue}{b \cdot a}} \]
      3. distribute-rgt-neg-in78.3%

        \[\leadsto x \cdot e^{\color{blue}{b \cdot \left(-a\right)}} \]
    5. Simplified78.3%

      \[\leadsto \color{blue}{x \cdot e^{b \cdot \left(-a\right)}} \]

    if 5.8e21 < y

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 98.6%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around inf 74.4%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. mul-1-neg74.4%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out74.4%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative74.4%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    7. Simplified74.4%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification75.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.45 \cdot 10^{+20}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{+21}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot b}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \end{array} \]

Alternative 6: 55.9% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -900000000:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -900000000.0) (* x (- 1.0 (* y t))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -900000000.0) {
		tmp = x * (1.0 - (y * t));
	} else {
		tmp = x * pow(z, y);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (t <= (-900000000.0d0)) then
        tmp = x * (1.0d0 - (y * t))
    else
        tmp = x * (z ** y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -900000000.0) {
		tmp = x * (1.0 - (y * t));
	} else {
		tmp = x * Math.pow(z, y);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if t <= -900000000.0:
		tmp = x * (1.0 - (y * t))
	else:
		tmp = x * math.pow(z, y)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -900000000.0)
		tmp = Float64(x * Float64(1.0 - Float64(y * t)));
	else
		tmp = Float64(x * (z ^ y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (t <= -900000000.0)
		tmp = x * (1.0 - (y * t));
	else
		tmp = x * (z ^ y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -900000000.0], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -900000000:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9e8

    1. Initial program 98.6%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def98.6%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg98.6%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 82.1%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around inf 82.1%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. mul-1-neg82.1%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out82.1%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative82.1%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    7. Simplified82.1%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    8. Taylor expanded in y around 0 30.6%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg30.6%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg30.6%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
      3. *-commutative30.6%

        \[\leadsto x - \color{blue}{\left(x \cdot y\right) \cdot t} \]
      4. associate-*l*34.4%

        \[\leadsto x - \color{blue}{x \cdot \left(y \cdot t\right)} \]
      5. *-commutative34.4%

        \[\leadsto x - x \cdot \color{blue}{\left(t \cdot y\right)} \]
    10. Simplified34.4%

      \[\leadsto \color{blue}{x - x \cdot \left(t \cdot y\right)} \]
    11. Taylor expanded in x around 0 34.4%

      \[\leadsto \color{blue}{x \cdot \left(1 - t \cdot y\right)} \]

    if -9e8 < t

    1. Initial program 96.8%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def96.8%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg96.8%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 73.1%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around 0 68.4%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \log z}} \]
    6. Taylor expanded in x around 0 68.4%

      \[\leadsto \color{blue}{x \cdot {z}^{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification59.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -900000000:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \]

Alternative 7: 29.7% accurate, 20.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -9.8 \cdot 10^{-138} \lor \neg \left(x \leq 3.8 \cdot 10^{-210} \lor \neg \left(x \leq 4.8 \cdot 10^{-155}\right) \land x \leq 3\right):\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= x -9.8e-138)
         (not (or (<= x 3.8e-210) (and (not (<= x 4.8e-155)) (<= x 3.0)))))
   (* x (- 1.0 (* y t)))
   (* a (* x (- z)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((x <= -9.8e-138) || !((x <= 3.8e-210) || (!(x <= 4.8e-155) && (x <= 3.0)))) {
		tmp = x * (1.0 - (y * t));
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if ((x <= (-9.8d-138)) .or. (.not. (x <= 3.8d-210) .or. (.not. (x <= 4.8d-155)) .and. (x <= 3.0d0))) then
        tmp = x * (1.0d0 - (y * t))
    else
        tmp = a * (x * -z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((x <= -9.8e-138) || !((x <= 3.8e-210) || (!(x <= 4.8e-155) && (x <= 3.0)))) {
		tmp = x * (1.0 - (y * t));
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (x <= -9.8e-138) or not ((x <= 3.8e-210) or (not (x <= 4.8e-155) and (x <= 3.0))):
		tmp = x * (1.0 - (y * t))
	else:
		tmp = a * (x * -z)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((x <= -9.8e-138) || !((x <= 3.8e-210) || (!(x <= 4.8e-155) && (x <= 3.0))))
		tmp = Float64(x * Float64(1.0 - Float64(y * t)));
	else
		tmp = Float64(a * Float64(x * Float64(-z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((x <= -9.8e-138) || ~(((x <= 3.8e-210) || (~((x <= 4.8e-155)) && (x <= 3.0)))))
		tmp = x * (1.0 - (y * t));
	else
		tmp = a * (x * -z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -9.8e-138], N[Not[Or[LessEqual[x, 3.8e-210], And[N[Not[LessEqual[x, 4.8e-155]], $MachinePrecision], LessEqual[x, 3.0]]]], $MachinePrecision]], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.8 \cdot 10^{-138} \lor \neg \left(x \leq 3.8 \cdot 10^{-210} \lor \neg \left(x \leq 4.8 \cdot 10^{-155}\right) \land x \leq 3\right):\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.80000000000000033e-138 or 3.80000000000000003e-210 < x < 4.8e-155 or 3 < x

    1. Initial program 96.7%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def96.7%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg96.7%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 75.2%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around inf 63.2%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. mul-1-neg63.2%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out63.2%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative63.2%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    7. Simplified63.2%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    8. Taylor expanded in y around 0 38.3%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg38.3%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg38.3%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
      3. *-commutative38.3%

        \[\leadsto x - \color{blue}{\left(x \cdot y\right) \cdot t} \]
      4. associate-*l*38.4%

        \[\leadsto x - \color{blue}{x \cdot \left(y \cdot t\right)} \]
      5. *-commutative38.4%

        \[\leadsto x - x \cdot \color{blue}{\left(t \cdot y\right)} \]
    10. Simplified38.4%

      \[\leadsto \color{blue}{x - x \cdot \left(t \cdot y\right)} \]
    11. Taylor expanded in x around 0 38.4%

      \[\leadsto \color{blue}{x \cdot \left(1 - t \cdot y\right)} \]

    if -9.80000000000000033e-138 < x < 3.80000000000000003e-210 or 4.8e-155 < x < 3

    1. Initial program 98.8%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 52.0%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in b around 0 11.9%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    4. Taylor expanded in z around 0 11.8%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg11.8%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot z\right)}\right) \]
      2. unsub-neg11.8%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    6. Simplified11.8%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    7. Taylor expanded in a around inf 35.7%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg35.7%

        \[\leadsto \color{blue}{-a \cdot \left(x \cdot z\right)} \]
      2. *-commutative35.7%

        \[\leadsto -\color{blue}{\left(x \cdot z\right) \cdot a} \]
      3. distribute-rgt-neg-in35.7%

        \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(-a\right)} \]
    9. Simplified35.7%

      \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(-a\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification37.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.8 \cdot 10^{-138} \lor \neg \left(x \leq 3.8 \cdot 10^{-210} \lor \neg \left(x \leq 4.8 \cdot 10^{-155}\right) \land x \leq 3\right):\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \]

Alternative 8: 29.6% accurate, 22.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{if}\;y \leq -2.2 \cdot 10^{+23}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{-12}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+184} \lor \neg \left(y \leq 4.5 \cdot 10^{+230}\right):\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (* y (- t)))))
   (if (<= y -2.2e+23)
     t_1
     (if (<= y 3.7e-12)
       x
       (if (or (<= y 3.5e+184) (not (<= y 4.5e+230)))
         (* z (* x (- a)))
         t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * (y * -t);
	double tmp;
	if (y <= -2.2e+23) {
		tmp = t_1;
	} else if (y <= 3.7e-12) {
		tmp = x;
	} else if ((y <= 3.5e+184) || !(y <= 4.5e+230)) {
		tmp = z * (x * -a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: tmp
    t_1 = x * (y * -t)
    if (y <= (-2.2d+23)) then
        tmp = t_1
    else if (y <= 3.7d-12) then
        tmp = x
    else if ((y <= 3.5d+184) .or. (.not. (y <= 4.5d+230))) then
        tmp = z * (x * -a)
    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 t_1 = x * (y * -t);
	double tmp;
	if (y <= -2.2e+23) {
		tmp = t_1;
	} else if (y <= 3.7e-12) {
		tmp = x;
	} else if ((y <= 3.5e+184) || !(y <= 4.5e+230)) {
		tmp = z * (x * -a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * (y * -t)
	tmp = 0
	if y <= -2.2e+23:
		tmp = t_1
	elif y <= 3.7e-12:
		tmp = x
	elif (y <= 3.5e+184) or not (y <= 4.5e+230):
		tmp = z * (x * -a)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * Float64(y * Float64(-t)))
	tmp = 0.0
	if (y <= -2.2e+23)
		tmp = t_1;
	elseif (y <= 3.7e-12)
		tmp = x;
	elseif ((y <= 3.5e+184) || !(y <= 4.5e+230))
		tmp = Float64(z * Float64(x * Float64(-a)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * (y * -t);
	tmp = 0.0;
	if (y <= -2.2e+23)
		tmp = t_1;
	elseif (y <= 3.7e-12)
		tmp = x;
	elseif ((y <= 3.5e+184) || ~((y <= 4.5e+230)))
		tmp = z * (x * -a);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(y * (-t)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e+23], t$95$1, If[LessEqual[y, 3.7e-12], x, If[Or[LessEqual[y, 3.5e+184], N[Not[LessEqual[y, 4.5e+230]], $MachinePrecision]], N[(z * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot \left(-t\right)\right)\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+23}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 3.7 \cdot 10^{-12}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{+184} \lor \neg \left(y \leq 4.5 \cdot 10^{+230}\right):\\
\;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.20000000000000008e23 or 3.49999999999999978e184 < y < 4.4999999999999999e230

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 93.6%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around inf 64.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. mul-1-neg64.8%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out64.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative64.8%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    7. Simplified64.8%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    8. Taylor expanded in y around 0 29.2%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg29.2%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg29.2%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
      3. *-commutative29.2%

        \[\leadsto x - \color{blue}{\left(x \cdot y\right) \cdot t} \]
      4. associate-*l*28.2%

        \[\leadsto x - \color{blue}{x \cdot \left(y \cdot t\right)} \]
      5. *-commutative28.2%

        \[\leadsto x - x \cdot \color{blue}{\left(t \cdot y\right)} \]
    10. Simplified28.2%

      \[\leadsto \color{blue}{x - x \cdot \left(t \cdot y\right)} \]
    11. Taylor expanded in t around inf 30.3%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    12. Step-by-step derivation
      1. mul-1-neg30.3%

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. associate-*r*25.4%

        \[\leadsto -\color{blue}{\left(t \cdot x\right) \cdot y} \]
      3. *-commutative25.4%

        \[\leadsto -\color{blue}{\left(x \cdot t\right)} \cdot y \]
      4. distribute-rgt-neg-in25.4%

        \[\leadsto \color{blue}{\left(x \cdot t\right) \cdot \left(-y\right)} \]
      5. associate-*r*29.1%

        \[\leadsto \color{blue}{x \cdot \left(t \cdot \left(-y\right)\right)} \]
    13. Simplified29.1%

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

    if -2.20000000000000008e23 < y < 3.69999999999999999e-12

    1. Initial program 95.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 83.3%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in a around 0 35.6%

      \[\leadsto \color{blue}{x} \]

    if 3.69999999999999999e-12 < y < 3.49999999999999978e184 or 4.4999999999999999e230 < y

    1. Initial program 98.4%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 36.2%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in b around 0 5.4%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    4. Taylor expanded in z around 0 5.4%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg5.4%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot z\right)}\right) \]
      2. unsub-neg5.4%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    6. Simplified5.4%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    7. Taylor expanded in a around inf 31.4%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg31.4%

        \[\leadsto \color{blue}{-a \cdot \left(x \cdot z\right)} \]
      2. associate-*r*32.4%

        \[\leadsto -\color{blue}{\left(a \cdot x\right) \cdot z} \]
    9. Simplified32.4%

      \[\leadsto \color{blue}{-\left(a \cdot x\right) \cdot z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification32.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+23}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{-12}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+184} \lor \neg \left(y \leq 4.5 \cdot 10^{+230}\right):\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \end{array} \]

Alternative 9: 29.6% accurate, 22.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{if}\;y \leq -3 \cdot 10^{+22}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-16}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+185}:\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{+230}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (* y (- t)))))
   (if (<= y -3e+22)
     t_1
     (if (<= y 2.6e-16)
       x
       (if (<= y 4e+185)
         (* z (* x (- a)))
         (if (<= y 4.2e+230) t_1 (* a (* x (- z)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * (y * -t);
	double tmp;
	if (y <= -3e+22) {
		tmp = t_1;
	} else if (y <= 2.6e-16) {
		tmp = x;
	} else if (y <= 4e+185) {
		tmp = z * (x * -a);
	} else if (y <= 4.2e+230) {
		tmp = t_1;
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: tmp
    t_1 = x * (y * -t)
    if (y <= (-3d+22)) then
        tmp = t_1
    else if (y <= 2.6d-16) then
        tmp = x
    else if (y <= 4d+185) then
        tmp = z * (x * -a)
    else if (y <= 4.2d+230) then
        tmp = t_1
    else
        tmp = a * (x * -z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * (y * -t);
	double tmp;
	if (y <= -3e+22) {
		tmp = t_1;
	} else if (y <= 2.6e-16) {
		tmp = x;
	} else if (y <= 4e+185) {
		tmp = z * (x * -a);
	} else if (y <= 4.2e+230) {
		tmp = t_1;
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * (y * -t)
	tmp = 0
	if y <= -3e+22:
		tmp = t_1
	elif y <= 2.6e-16:
		tmp = x
	elif y <= 4e+185:
		tmp = z * (x * -a)
	elif y <= 4.2e+230:
		tmp = t_1
	else:
		tmp = a * (x * -z)
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * Float64(y * Float64(-t)))
	tmp = 0.0
	if (y <= -3e+22)
		tmp = t_1;
	elseif (y <= 2.6e-16)
		tmp = x;
	elseif (y <= 4e+185)
		tmp = Float64(z * Float64(x * Float64(-a)));
	elseif (y <= 4.2e+230)
		tmp = t_1;
	else
		tmp = Float64(a * Float64(x * Float64(-z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * (y * -t);
	tmp = 0.0;
	if (y <= -3e+22)
		tmp = t_1;
	elseif (y <= 2.6e-16)
		tmp = x;
	elseif (y <= 4e+185)
		tmp = z * (x * -a);
	elseif (y <= 4.2e+230)
		tmp = t_1;
	else
		tmp = a * (x * -z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(y * (-t)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3e+22], t$95$1, If[LessEqual[y, 2.6e-16], x, If[LessEqual[y, 4e+185], N[(z * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+230], t$95$1, N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot \left(-t\right)\right)\\
\mathbf{if}\;y \leq -3 \cdot 10^{+22}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.6 \cdot 10^{-16}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 4 \cdot 10^{+185}:\\
\;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{+230}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3e22 or 3.9999999999999999e185 < y < 4.19999999999999986e230

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 93.6%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around inf 64.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. mul-1-neg64.8%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out64.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative64.8%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    7. Simplified64.8%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    8. Taylor expanded in y around 0 29.2%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg29.2%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg29.2%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
      3. *-commutative29.2%

        \[\leadsto x - \color{blue}{\left(x \cdot y\right) \cdot t} \]
      4. associate-*l*28.2%

        \[\leadsto x - \color{blue}{x \cdot \left(y \cdot t\right)} \]
      5. *-commutative28.2%

        \[\leadsto x - x \cdot \color{blue}{\left(t \cdot y\right)} \]
    10. Simplified28.2%

      \[\leadsto \color{blue}{x - x \cdot \left(t \cdot y\right)} \]
    11. Taylor expanded in t around inf 30.3%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    12. Step-by-step derivation
      1. mul-1-neg30.3%

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. associate-*r*25.4%

        \[\leadsto -\color{blue}{\left(t \cdot x\right) \cdot y} \]
      3. *-commutative25.4%

        \[\leadsto -\color{blue}{\left(x \cdot t\right)} \cdot y \]
      4. distribute-rgt-neg-in25.4%

        \[\leadsto \color{blue}{\left(x \cdot t\right) \cdot \left(-y\right)} \]
      5. associate-*r*29.1%

        \[\leadsto \color{blue}{x \cdot \left(t \cdot \left(-y\right)\right)} \]
    13. Simplified29.1%

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

    if -3e22 < y < 2.5999999999999998e-16

    1. Initial program 95.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 83.3%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in a around 0 35.6%

      \[\leadsto \color{blue}{x} \]

    if 2.5999999999999998e-16 < y < 3.9999999999999999e185

    1. Initial program 97.7%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 40.5%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in b around 0 6.1%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    4. Taylor expanded in z around 0 6.2%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg6.2%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot z\right)}\right) \]
      2. unsub-neg6.2%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    6. Simplified6.2%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    7. Taylor expanded in a around inf 30.9%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg30.9%

        \[\leadsto \color{blue}{-a \cdot \left(x \cdot z\right)} \]
      2. associate-*r*33.0%

        \[\leadsto -\color{blue}{\left(a \cdot x\right) \cdot z} \]
    9. Simplified33.0%

      \[\leadsto \color{blue}{-\left(a \cdot x\right) \cdot z} \]

    if 4.19999999999999986e230 < y

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 27.3%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in b around 0 3.8%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    4. Taylor expanded in z around 0 3.8%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg3.8%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot z\right)}\right) \]
      2. unsub-neg3.8%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    6. Simplified3.8%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    7. Taylor expanded in a around inf 32.3%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg32.3%

        \[\leadsto \color{blue}{-a \cdot \left(x \cdot z\right)} \]
      2. *-commutative32.3%

        \[\leadsto -\color{blue}{\left(x \cdot z\right) \cdot a} \]
      3. distribute-rgt-neg-in32.3%

        \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(-a\right)} \]
    9. Simplified32.3%

      \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(-a\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification33.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{+22}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-16}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+185}:\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{+230}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \]

Alternative 10: 29.6% accurate, 22.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+19}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\

\mathbf{elif}\;y \leq 2.7 \cdot 10^{-19}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.05 \cdot 10^{+181}:\\
\;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\

\mathbf{elif}\;y \leq 4.6 \cdot 10^{+230}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -5.5e19

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 92.1%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around inf 62.6%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. mul-1-neg62.6%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out62.6%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative62.6%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    7. Simplified62.6%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    8. Taylor expanded in y around 0 27.7%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg27.7%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg27.7%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
      3. *-commutative27.7%

        \[\leadsto x - \color{blue}{\left(x \cdot y\right) \cdot t} \]
      4. associate-*l*24.9%

        \[\leadsto x - \color{blue}{x \cdot \left(y \cdot t\right)} \]
      5. *-commutative24.9%

        \[\leadsto x - x \cdot \color{blue}{\left(t \cdot y\right)} \]
    10. Simplified24.9%

      \[\leadsto \color{blue}{x - x \cdot \left(t \cdot y\right)} \]
    11. Taylor expanded in t around inf 27.6%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]

    if -5.5e19 < y < 2.7000000000000001e-19

    1. Initial program 95.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 83.3%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in a around 0 35.6%

      \[\leadsto \color{blue}{x} \]

    if 2.7000000000000001e-19 < y < 1.04999999999999999e181

    1. Initial program 97.7%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 40.5%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in b around 0 6.1%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    4. Taylor expanded in z around 0 6.2%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg6.2%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot z\right)}\right) \]
      2. unsub-neg6.2%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    6. Simplified6.2%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    7. Taylor expanded in a around inf 30.9%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg30.9%

        \[\leadsto \color{blue}{-a \cdot \left(x \cdot z\right)} \]
      2. associate-*r*33.0%

        \[\leadsto -\color{blue}{\left(a \cdot x\right) \cdot z} \]
    9. Simplified33.0%

      \[\leadsto \color{blue}{-\left(a \cdot x\right) \cdot z} \]

    if 1.04999999999999999e181 < y < 4.5999999999999996e230

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 100.0%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around inf 74.3%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. mul-1-neg74.3%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out74.3%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative74.3%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    7. Simplified74.3%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    8. Taylor expanded in y around 0 35.5%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg35.5%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg35.5%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
      3. *-commutative35.5%

        \[\leadsto x - \color{blue}{\left(x \cdot y\right) \cdot t} \]
      4. associate-*l*42.0%

        \[\leadsto x - \color{blue}{x \cdot \left(y \cdot t\right)} \]
      5. *-commutative42.0%

        \[\leadsto x - x \cdot \color{blue}{\left(t \cdot y\right)} \]
    10. Simplified42.0%

      \[\leadsto \color{blue}{x - x \cdot \left(t \cdot y\right)} \]
    11. Taylor expanded in t around inf 41.6%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    12. Step-by-step derivation
      1. mul-1-neg41.6%

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. associate-*r*41.6%

        \[\leadsto -\color{blue}{\left(t \cdot x\right) \cdot y} \]
      3. *-commutative41.6%

        \[\leadsto -\color{blue}{\left(x \cdot t\right)} \cdot y \]
      4. distribute-rgt-neg-in41.6%

        \[\leadsto \color{blue}{\left(x \cdot t\right) \cdot \left(-y\right)} \]
      5. associate-*r*48.0%

        \[\leadsto \color{blue}{x \cdot \left(t \cdot \left(-y\right)\right)} \]
    13. Simplified48.0%

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

    if 4.5999999999999996e230 < y

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 27.3%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in b around 0 3.8%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    4. Taylor expanded in z around 0 3.8%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg3.8%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot z\right)}\right) \]
      2. unsub-neg3.8%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    6. Simplified3.8%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    7. Taylor expanded in a around inf 32.3%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg32.3%

        \[\leadsto \color{blue}{-a \cdot \left(x \cdot z\right)} \]
      2. *-commutative32.3%

        \[\leadsto -\color{blue}{\left(x \cdot z\right) \cdot a} \]
      3. distribute-rgt-neg-in32.3%

        \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(-a\right)} \]
    9. Simplified32.3%

      \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(-a\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification33.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+19}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-19}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+181}:\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{+230}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \]

Alternative 11: 30.3% accurate, 22.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{-21}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-13}:\\ \;\;\;\;x \cdot \left(1 - z \cdot a\right)\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+182}:\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+230}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -2.4e-21)
   (* t (* x (- y)))
   (if (<= y 2.7e-13)
     (* x (- 1.0 (* z a)))
     (if (<= y 3e+182)
       (* z (* x (- a)))
       (if (<= y 1.75e+230) (* x (* y (- t))) (* a (* x (- z))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -2.4e-21) {
		tmp = t * (x * -y);
	} else if (y <= 2.7e-13) {
		tmp = x * (1.0 - (z * a));
	} else if (y <= 3e+182) {
		tmp = z * (x * -a);
	} else if (y <= 1.75e+230) {
		tmp = x * (y * -t);
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (y <= (-2.4d-21)) then
        tmp = t * (x * -y)
    else if (y <= 2.7d-13) then
        tmp = x * (1.0d0 - (z * a))
    else if (y <= 3d+182) then
        tmp = z * (x * -a)
    else if (y <= 1.75d+230) then
        tmp = x * (y * -t)
    else
        tmp = a * (x * -z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -2.4e-21) {
		tmp = t * (x * -y);
	} else if (y <= 2.7e-13) {
		tmp = x * (1.0 - (z * a));
	} else if (y <= 3e+182) {
		tmp = z * (x * -a);
	} else if (y <= 1.75e+230) {
		tmp = x * (y * -t);
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -2.4e-21:
		tmp = t * (x * -y)
	elif y <= 2.7e-13:
		tmp = x * (1.0 - (z * a))
	elif y <= 3e+182:
		tmp = z * (x * -a)
	elif y <= 1.75e+230:
		tmp = x * (y * -t)
	else:
		tmp = a * (x * -z)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -2.4e-21)
		tmp = Float64(t * Float64(x * Float64(-y)));
	elseif (y <= 2.7e-13)
		tmp = Float64(x * Float64(1.0 - Float64(z * a)));
	elseif (y <= 3e+182)
		tmp = Float64(z * Float64(x * Float64(-a)));
	elseif (y <= 1.75e+230)
		tmp = Float64(x * Float64(y * Float64(-t)));
	else
		tmp = Float64(a * Float64(x * Float64(-z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -2.4e-21)
		tmp = t * (x * -y);
	elseif (y <= 2.7e-13)
		tmp = x * (1.0 - (z * a));
	elseif (y <= 3e+182)
		tmp = z * (x * -a);
	elseif (y <= 1.75e+230)
		tmp = x * (y * -t);
	else
		tmp = a * (x * -z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.4e-21], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e-13], N[(x * N[(1.0 - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e+182], N[(z * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e+230], N[(x * N[(y * (-t)), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-21}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\

\mathbf{elif}\;y \leq 2.7 \cdot 10^{-13}:\\
\;\;\;\;x \cdot \left(1 - z \cdot a\right)\\

\mathbf{elif}\;y \leq 3 \cdot 10^{+182}:\\
\;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\

\mathbf{elif}\;y \leq 1.75 \cdot 10^{+230}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -2.3999999999999999e-21

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 88.8%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around inf 62.7%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. mul-1-neg62.7%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out62.7%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative62.7%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    7. Simplified62.7%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    8. Taylor expanded in y around 0 24.9%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg24.9%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg24.9%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
      3. *-commutative24.9%

        \[\leadsto x - \color{blue}{\left(x \cdot y\right) \cdot t} \]
      4. associate-*l*22.4%

        \[\leadsto x - \color{blue}{x \cdot \left(y \cdot t\right)} \]
      5. *-commutative22.4%

        \[\leadsto x - x \cdot \color{blue}{\left(t \cdot y\right)} \]
    10. Simplified22.4%

      \[\leadsto \color{blue}{x - x \cdot \left(t \cdot y\right)} \]
    11. Taylor expanded in t around inf 24.8%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]

    if -2.3999999999999999e-21 < y < 2.70000000000000011e-13

    1. Initial program 94.6%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 84.7%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in b around 0 41.5%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    4. Taylor expanded in z around 0 40.3%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg40.3%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot z\right)}\right) \]
      2. unsub-neg40.3%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    6. Simplified40.3%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]

    if 2.70000000000000011e-13 < y < 3.0000000000000002e182

    1. Initial program 97.7%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 40.5%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in b around 0 6.1%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    4. Taylor expanded in z around 0 6.2%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg6.2%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot z\right)}\right) \]
      2. unsub-neg6.2%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    6. Simplified6.2%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    7. Taylor expanded in a around inf 30.9%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg30.9%

        \[\leadsto \color{blue}{-a \cdot \left(x \cdot z\right)} \]
      2. associate-*r*33.0%

        \[\leadsto -\color{blue}{\left(a \cdot x\right) \cdot z} \]
    9. Simplified33.0%

      \[\leadsto \color{blue}{-\left(a \cdot x\right) \cdot z} \]

    if 3.0000000000000002e182 < y < 1.75e230

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 100.0%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around inf 74.3%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. mul-1-neg74.3%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out74.3%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative74.3%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    7. Simplified74.3%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    8. Taylor expanded in y around 0 35.5%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg35.5%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg35.5%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
      3. *-commutative35.5%

        \[\leadsto x - \color{blue}{\left(x \cdot y\right) \cdot t} \]
      4. associate-*l*42.0%

        \[\leadsto x - \color{blue}{x \cdot \left(y \cdot t\right)} \]
      5. *-commutative42.0%

        \[\leadsto x - x \cdot \color{blue}{\left(t \cdot y\right)} \]
    10. Simplified42.0%

      \[\leadsto \color{blue}{x - x \cdot \left(t \cdot y\right)} \]
    11. Taylor expanded in t around inf 41.6%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    12. Step-by-step derivation
      1. mul-1-neg41.6%

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. associate-*r*41.6%

        \[\leadsto -\color{blue}{\left(t \cdot x\right) \cdot y} \]
      3. *-commutative41.6%

        \[\leadsto -\color{blue}{\left(x \cdot t\right)} \cdot y \]
      4. distribute-rgt-neg-in41.6%

        \[\leadsto \color{blue}{\left(x \cdot t\right) \cdot \left(-y\right)} \]
      5. associate-*r*48.0%

        \[\leadsto \color{blue}{x \cdot \left(t \cdot \left(-y\right)\right)} \]
    13. Simplified48.0%

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

    if 1.75e230 < y

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 27.3%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in b around 0 3.8%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    4. Taylor expanded in z around 0 3.8%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg3.8%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot z\right)}\right) \]
      2. unsub-neg3.8%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    6. Simplified3.8%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    7. Taylor expanded in a around inf 32.3%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg32.3%

        \[\leadsto \color{blue}{-a \cdot \left(x \cdot z\right)} \]
      2. *-commutative32.3%

        \[\leadsto -\color{blue}{\left(x \cdot z\right) \cdot a} \]
      3. distribute-rgt-neg-in32.3%

        \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(-a\right)} \]
    9. Simplified32.3%

      \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(-a\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification34.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{-21}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-13}:\\ \;\;\;\;x \cdot \left(1 - z \cdot a\right)\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+182}:\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+230}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \]

Alternative 12: 33.0% accurate, 22.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+68}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{-12}:\\ \;\;\;\;x - b \cdot \left(x \cdot a\right)\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+182}:\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{+230}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -3.1e+68)
   (* t (* x (- y)))
   (if (<= y 6.8e-12)
     (- x (* b (* x a)))
     (if (<= y 5e+182)
       (* z (* x (- a)))
       (if (<= y 2.5e+230) (* x (* y (- t))) (* a (* x (- z))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -3.1e+68) {
		tmp = t * (x * -y);
	} else if (y <= 6.8e-12) {
		tmp = x - (b * (x * a));
	} else if (y <= 5e+182) {
		tmp = z * (x * -a);
	} else if (y <= 2.5e+230) {
		tmp = x * (y * -t);
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (y <= (-3.1d+68)) then
        tmp = t * (x * -y)
    else if (y <= 6.8d-12) then
        tmp = x - (b * (x * a))
    else if (y <= 5d+182) then
        tmp = z * (x * -a)
    else if (y <= 2.5d+230) then
        tmp = x * (y * -t)
    else
        tmp = a * (x * -z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -3.1e+68) {
		tmp = t * (x * -y);
	} else if (y <= 6.8e-12) {
		tmp = x - (b * (x * a));
	} else if (y <= 5e+182) {
		tmp = z * (x * -a);
	} else if (y <= 2.5e+230) {
		tmp = x * (y * -t);
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -3.1e+68:
		tmp = t * (x * -y)
	elif y <= 6.8e-12:
		tmp = x - (b * (x * a))
	elif y <= 5e+182:
		tmp = z * (x * -a)
	elif y <= 2.5e+230:
		tmp = x * (y * -t)
	else:
		tmp = a * (x * -z)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -3.1e+68)
		tmp = Float64(t * Float64(x * Float64(-y)));
	elseif (y <= 6.8e-12)
		tmp = Float64(x - Float64(b * Float64(x * a)));
	elseif (y <= 5e+182)
		tmp = Float64(z * Float64(x * Float64(-a)));
	elseif (y <= 2.5e+230)
		tmp = Float64(x * Float64(y * Float64(-t)));
	else
		tmp = Float64(a * Float64(x * Float64(-z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -3.1e+68)
		tmp = t * (x * -y);
	elseif (y <= 6.8e-12)
		tmp = x - (b * (x * a));
	elseif (y <= 5e+182)
		tmp = z * (x * -a);
	elseif (y <= 2.5e+230)
		tmp = x * (y * -t);
	else
		tmp = a * (x * -z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.1e+68], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e-12], N[(x - N[(b * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+182], N[(z * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e+230], N[(x * N[(y * (-t)), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+68}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\

\mathbf{elif}\;y \leq 6.8 \cdot 10^{-12}:\\
\;\;\;\;x - b \cdot \left(x \cdot a\right)\\

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

\mathbf{elif}\;y \leq 2.5 \cdot 10^{+230}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -3.0999999999999998e68

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 90.7%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around inf 61.6%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. mul-1-neg61.6%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out61.6%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative61.6%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    7. Simplified61.6%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    8. Taylor expanded in y around 0 30.0%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg30.0%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg30.0%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
      3. *-commutative30.0%

        \[\leadsto x - \color{blue}{\left(x \cdot y\right) \cdot t} \]
      4. associate-*l*24.9%

        \[\leadsto x - \color{blue}{x \cdot \left(y \cdot t\right)} \]
      5. *-commutative24.9%

        \[\leadsto x - x \cdot \color{blue}{\left(t \cdot y\right)} \]
    10. Simplified24.9%

      \[\leadsto \color{blue}{x - x \cdot \left(t \cdot y\right)} \]
    11. Taylor expanded in t around inf 29.9%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]

    if -3.0999999999999998e68 < y < 6.8000000000000001e-12

    1. Initial program 95.3%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def95.3%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg95.3%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Step-by-step derivation
      1. add-log-exp100.0%

        \[\leadsto x \cdot e^{\color{blue}{\log \left(e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}\right)}} \]
      2. add-cube-cbrt99.9%

        \[\leadsto x \cdot e^{\log \color{blue}{\left(\left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}}\right) \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}}\right)}} \]
      3. log-prod99.9%

        \[\leadsto x \cdot e^{\color{blue}{\log \left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}}\right) + \log \left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}}\right)}} \]
    5. Applied egg-rr91.3%

      \[\leadsto x \cdot e^{\color{blue}{\log \left({\left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right)}}\right)}^{2}\right) + \log \left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right)}}\right)}} \]
    6. Step-by-step derivation
      1. log-pow91.3%

        \[\leadsto x \cdot e^{\color{blue}{2 \cdot \log \left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right)}}\right)} + \log \left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right)}}\right)} \]
      2. distribute-lft1-in91.3%

        \[\leadsto x \cdot e^{\color{blue}{\left(2 + 1\right) \cdot \log \left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right)}}\right)}} \]
      3. metadata-eval91.3%

        \[\leadsto x \cdot e^{\color{blue}{3} \cdot \log \left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right)}}\right)} \]
    7. Simplified91.3%

      \[\leadsto x \cdot e^{\color{blue}{3 \cdot \log \left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right)}}\right)}} \]
    8. Taylor expanded in b around inf 77.6%

      \[\leadsto x \cdot e^{3 \cdot \log \left(\sqrt[3]{e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}}}\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg77.6%

        \[\leadsto x \cdot e^{3 \cdot \log \left(\sqrt[3]{e^{\color{blue}{-a \cdot b}}}\right)} \]
      2. *-commutative77.6%

        \[\leadsto x \cdot e^{3 \cdot \log \left(\sqrt[3]{e^{-\color{blue}{b \cdot a}}}\right)} \]
      3. distribute-rgt-neg-in77.6%

        \[\leadsto x \cdot e^{3 \cdot \log \left(\sqrt[3]{e^{\color{blue}{b \cdot \left(-a\right)}}}\right)} \]
    10. Simplified77.6%

      \[\leadsto x \cdot e^{3 \cdot \log \left(\sqrt[3]{e^{\color{blue}{b \cdot \left(-a\right)}}}\right)} \]
    11. Taylor expanded in b around 0 44.3%

      \[\leadsto \color{blue}{x + -1 \cdot \left(a \cdot \left(b \cdot x\right)\right)} \]
    12. Step-by-step derivation
      1. mul-1-neg44.3%

        \[\leadsto x + \color{blue}{\left(-a \cdot \left(b \cdot x\right)\right)} \]
      2. unsub-neg44.3%

        \[\leadsto \color{blue}{x - a \cdot \left(b \cdot x\right)} \]
      3. associate-*r*46.6%

        \[\leadsto x - \color{blue}{\left(a \cdot b\right) \cdot x} \]
      4. *-commutative46.6%

        \[\leadsto x - \color{blue}{\left(b \cdot a\right)} \cdot x \]
      5. associate-*l*45.6%

        \[\leadsto x - \color{blue}{b \cdot \left(a \cdot x\right)} \]
    13. Simplified45.6%

      \[\leadsto \color{blue}{x - b \cdot \left(a \cdot x\right)} \]

    if 6.8000000000000001e-12 < y < 4.99999999999999973e182

    1. Initial program 97.7%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 40.5%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in b around 0 6.1%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    4. Taylor expanded in z around 0 6.2%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg6.2%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot z\right)}\right) \]
      2. unsub-neg6.2%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    6. Simplified6.2%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    7. Taylor expanded in a around inf 30.9%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg30.9%

        \[\leadsto \color{blue}{-a \cdot \left(x \cdot z\right)} \]
      2. associate-*r*33.0%

        \[\leadsto -\color{blue}{\left(a \cdot x\right) \cdot z} \]
    9. Simplified33.0%

      \[\leadsto \color{blue}{-\left(a \cdot x\right) \cdot z} \]

    if 4.99999999999999973e182 < y < 2.5000000000000001e230

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 100.0%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around inf 74.3%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. mul-1-neg74.3%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out74.3%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative74.3%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    7. Simplified74.3%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    8. Taylor expanded in y around 0 35.5%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg35.5%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg35.5%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
      3. *-commutative35.5%

        \[\leadsto x - \color{blue}{\left(x \cdot y\right) \cdot t} \]
      4. associate-*l*42.0%

        \[\leadsto x - \color{blue}{x \cdot \left(y \cdot t\right)} \]
      5. *-commutative42.0%

        \[\leadsto x - x \cdot \color{blue}{\left(t \cdot y\right)} \]
    10. Simplified42.0%

      \[\leadsto \color{blue}{x - x \cdot \left(t \cdot y\right)} \]
    11. Taylor expanded in t around inf 41.6%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    12. Step-by-step derivation
      1. mul-1-neg41.6%

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. associate-*r*41.6%

        \[\leadsto -\color{blue}{\left(t \cdot x\right) \cdot y} \]
      3. *-commutative41.6%

        \[\leadsto -\color{blue}{\left(x \cdot t\right)} \cdot y \]
      4. distribute-rgt-neg-in41.6%

        \[\leadsto \color{blue}{\left(x \cdot t\right) \cdot \left(-y\right)} \]
      5. associate-*r*48.0%

        \[\leadsto \color{blue}{x \cdot \left(t \cdot \left(-y\right)\right)} \]
    13. Simplified48.0%

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

    if 2.5000000000000001e230 < y

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 27.3%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in b around 0 3.8%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    4. Taylor expanded in z around 0 3.8%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg3.8%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot z\right)}\right) \]
      2. unsub-neg3.8%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    6. Simplified3.8%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    7. Taylor expanded in a around inf 32.3%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg32.3%

        \[\leadsto \color{blue}{-a \cdot \left(x \cdot z\right)} \]
      2. *-commutative32.3%

        \[\leadsto -\color{blue}{\left(x \cdot z\right) \cdot a} \]
      3. distribute-rgt-neg-in32.3%

        \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(-a\right)} \]
    9. Simplified32.3%

      \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(-a\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification39.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+68}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{-12}:\\ \;\;\;\;x - b \cdot \left(x \cdot a\right)\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+182}:\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{+230}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \]

Alternative 13: 33.0% accurate, 22.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -6.6 \cdot 10^{+72}:\\ \;\;\;\;x - t \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-15}:\\ \;\;\;\;x - b \cdot \left(x \cdot a\right)\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+179}:\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+229}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -6.6e+72)
   (- x (* t (* x y)))
   (if (<= y 6e-15)
     (- x (* b (* x a)))
     (if (<= y 6.5e+179)
       (* z (* x (- a)))
       (if (<= y 8.5e+229) (* x (* y (- t))) (* a (* x (- z))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -6.6e+72) {
		tmp = x - (t * (x * y));
	} else if (y <= 6e-15) {
		tmp = x - (b * (x * a));
	} else if (y <= 6.5e+179) {
		tmp = z * (x * -a);
	} else if (y <= 8.5e+229) {
		tmp = x * (y * -t);
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (y <= (-6.6d+72)) then
        tmp = x - (t * (x * y))
    else if (y <= 6d-15) then
        tmp = x - (b * (x * a))
    else if (y <= 6.5d+179) then
        tmp = z * (x * -a)
    else if (y <= 8.5d+229) then
        tmp = x * (y * -t)
    else
        tmp = a * (x * -z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -6.6e+72) {
		tmp = x - (t * (x * y));
	} else if (y <= 6e-15) {
		tmp = x - (b * (x * a));
	} else if (y <= 6.5e+179) {
		tmp = z * (x * -a);
	} else if (y <= 8.5e+229) {
		tmp = x * (y * -t);
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -6.6e+72:
		tmp = x - (t * (x * y))
	elif y <= 6e-15:
		tmp = x - (b * (x * a))
	elif y <= 6.5e+179:
		tmp = z * (x * -a)
	elif y <= 8.5e+229:
		tmp = x * (y * -t)
	else:
		tmp = a * (x * -z)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -6.6e+72)
		tmp = Float64(x - Float64(t * Float64(x * y)));
	elseif (y <= 6e-15)
		tmp = Float64(x - Float64(b * Float64(x * a)));
	elseif (y <= 6.5e+179)
		tmp = Float64(z * Float64(x * Float64(-a)));
	elseif (y <= 8.5e+229)
		tmp = Float64(x * Float64(y * Float64(-t)));
	else
		tmp = Float64(a * Float64(x * Float64(-z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -6.6e+72)
		tmp = x - (t * (x * y));
	elseif (y <= 6e-15)
		tmp = x - (b * (x * a));
	elseif (y <= 6.5e+179)
		tmp = z * (x * -a);
	elseif (y <= 8.5e+229)
		tmp = x * (y * -t);
	else
		tmp = a * (x * -z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -6.6e+72], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e-15], N[(x - N[(b * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e+179], N[(z * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+229], N[(x * N[(y * (-t)), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{+72}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\

\mathbf{elif}\;y \leq 6 \cdot 10^{-15}:\\
\;\;\;\;x - b \cdot \left(x \cdot a\right)\\

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

\mathbf{elif}\;y \leq 8.5 \cdot 10^{+229}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -6.6e72

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 90.7%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around inf 61.6%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. mul-1-neg61.6%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out61.6%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative61.6%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    7. Simplified61.6%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    8. Taylor expanded in y around 0 30.0%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg30.0%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg30.0%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
      3. *-commutative30.0%

        \[\leadsto x - \color{blue}{\left(x \cdot y\right) \cdot t} \]
      4. associate-*l*24.9%

        \[\leadsto x - \color{blue}{x \cdot \left(y \cdot t\right)} \]
      5. *-commutative24.9%

        \[\leadsto x - x \cdot \color{blue}{\left(t \cdot y\right)} \]
    10. Simplified24.9%

      \[\leadsto \color{blue}{x - x \cdot \left(t \cdot y\right)} \]
    11. Taylor expanded in x around 0 30.0%

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

    if -6.6e72 < y < 6e-15

    1. Initial program 95.3%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def95.3%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg95.3%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Step-by-step derivation
      1. add-log-exp100.0%

        \[\leadsto x \cdot e^{\color{blue}{\log \left(e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}\right)}} \]
      2. add-cube-cbrt99.9%

        \[\leadsto x \cdot e^{\log \color{blue}{\left(\left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}}\right) \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}}\right)}} \]
      3. log-prod99.9%

        \[\leadsto x \cdot e^{\color{blue}{\log \left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}}\right) + \log \left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}}\right)}} \]
    5. Applied egg-rr91.3%

      \[\leadsto x \cdot e^{\color{blue}{\log \left({\left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right)}}\right)}^{2}\right) + \log \left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right)}}\right)}} \]
    6. Step-by-step derivation
      1. log-pow91.3%

        \[\leadsto x \cdot e^{\color{blue}{2 \cdot \log \left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right)}}\right)} + \log \left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right)}}\right)} \]
      2. distribute-lft1-in91.3%

        \[\leadsto x \cdot e^{\color{blue}{\left(2 + 1\right) \cdot \log \left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right)}}\right)}} \]
      3. metadata-eval91.3%

        \[\leadsto x \cdot e^{\color{blue}{3} \cdot \log \left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right)}}\right)} \]
    7. Simplified91.3%

      \[\leadsto x \cdot e^{\color{blue}{3 \cdot \log \left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right)}}\right)}} \]
    8. Taylor expanded in b around inf 77.6%

      \[\leadsto x \cdot e^{3 \cdot \log \left(\sqrt[3]{e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}}}\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg77.6%

        \[\leadsto x \cdot e^{3 \cdot \log \left(\sqrt[3]{e^{\color{blue}{-a \cdot b}}}\right)} \]
      2. *-commutative77.6%

        \[\leadsto x \cdot e^{3 \cdot \log \left(\sqrt[3]{e^{-\color{blue}{b \cdot a}}}\right)} \]
      3. distribute-rgt-neg-in77.6%

        \[\leadsto x \cdot e^{3 \cdot \log \left(\sqrt[3]{e^{\color{blue}{b \cdot \left(-a\right)}}}\right)} \]
    10. Simplified77.6%

      \[\leadsto x \cdot e^{3 \cdot \log \left(\sqrt[3]{e^{\color{blue}{b \cdot \left(-a\right)}}}\right)} \]
    11. Taylor expanded in b around 0 44.3%

      \[\leadsto \color{blue}{x + -1 \cdot \left(a \cdot \left(b \cdot x\right)\right)} \]
    12. Step-by-step derivation
      1. mul-1-neg44.3%

        \[\leadsto x + \color{blue}{\left(-a \cdot \left(b \cdot x\right)\right)} \]
      2. unsub-neg44.3%

        \[\leadsto \color{blue}{x - a \cdot \left(b \cdot x\right)} \]
      3. associate-*r*46.6%

        \[\leadsto x - \color{blue}{\left(a \cdot b\right) \cdot x} \]
      4. *-commutative46.6%

        \[\leadsto x - \color{blue}{\left(b \cdot a\right)} \cdot x \]
      5. associate-*l*45.6%

        \[\leadsto x - \color{blue}{b \cdot \left(a \cdot x\right)} \]
    13. Simplified45.6%

      \[\leadsto \color{blue}{x - b \cdot \left(a \cdot x\right)} \]

    if 6e-15 < y < 6.50000000000000052e179

    1. Initial program 97.7%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 40.5%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in b around 0 6.1%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    4. Taylor expanded in z around 0 6.2%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg6.2%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot z\right)}\right) \]
      2. unsub-neg6.2%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    6. Simplified6.2%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    7. Taylor expanded in a around inf 30.9%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg30.9%

        \[\leadsto \color{blue}{-a \cdot \left(x \cdot z\right)} \]
      2. associate-*r*33.0%

        \[\leadsto -\color{blue}{\left(a \cdot x\right) \cdot z} \]
    9. Simplified33.0%

      \[\leadsto \color{blue}{-\left(a \cdot x\right) \cdot z} \]

    if 6.50000000000000052e179 < y < 8.49999999999999966e229

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 100.0%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around inf 74.3%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. mul-1-neg74.3%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out74.3%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative74.3%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    7. Simplified74.3%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    8. Taylor expanded in y around 0 35.5%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg35.5%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg35.5%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
      3. *-commutative35.5%

        \[\leadsto x - \color{blue}{\left(x \cdot y\right) \cdot t} \]
      4. associate-*l*42.0%

        \[\leadsto x - \color{blue}{x \cdot \left(y \cdot t\right)} \]
      5. *-commutative42.0%

        \[\leadsto x - x \cdot \color{blue}{\left(t \cdot y\right)} \]
    10. Simplified42.0%

      \[\leadsto \color{blue}{x - x \cdot \left(t \cdot y\right)} \]
    11. Taylor expanded in t around inf 41.6%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    12. Step-by-step derivation
      1. mul-1-neg41.6%

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. associate-*r*41.6%

        \[\leadsto -\color{blue}{\left(t \cdot x\right) \cdot y} \]
      3. *-commutative41.6%

        \[\leadsto -\color{blue}{\left(x \cdot t\right)} \cdot y \]
      4. distribute-rgt-neg-in41.6%

        \[\leadsto \color{blue}{\left(x \cdot t\right) \cdot \left(-y\right)} \]
      5. associate-*r*48.0%

        \[\leadsto \color{blue}{x \cdot \left(t \cdot \left(-y\right)\right)} \]
    13. Simplified48.0%

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

    if 8.49999999999999966e229 < y

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 27.3%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in b around 0 3.8%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    4. Taylor expanded in z around 0 3.8%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg3.8%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot z\right)}\right) \]
      2. unsub-neg3.8%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    6. Simplified3.8%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    7. Taylor expanded in a around inf 32.3%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg32.3%

        \[\leadsto \color{blue}{-a \cdot \left(x \cdot z\right)} \]
      2. *-commutative32.3%

        \[\leadsto -\color{blue}{\left(x \cdot z\right) \cdot a} \]
      3. distribute-rgt-neg-in32.3%

        \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(-a\right)} \]
    9. Simplified32.3%

      \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(-a\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification39.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.6 \cdot 10^{+72}:\\ \;\;\;\;x - t \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-15}:\\ \;\;\;\;x - b \cdot \left(x \cdot a\right)\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+179}:\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+229}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \]

Alternative 14: 34.2% accurate, 22.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{+70}:\\ \;\;\;\;x - t \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-11}:\\ \;\;\;\;x - x \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+186}:\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+229}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -2.6e+70)
   (- x (* t (* x y)))
   (if (<= y 3.5e-11)
     (- x (* x (* a b)))
     (if (<= y 4e+186)
       (* z (* x (- a)))
       (if (<= y 9.5e+229) (* x (* y (- t))) (* a (* x (- z))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -2.6e+70) {
		tmp = x - (t * (x * y));
	} else if (y <= 3.5e-11) {
		tmp = x - (x * (a * b));
	} else if (y <= 4e+186) {
		tmp = z * (x * -a);
	} else if (y <= 9.5e+229) {
		tmp = x * (y * -t);
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (y <= (-2.6d+70)) then
        tmp = x - (t * (x * y))
    else if (y <= 3.5d-11) then
        tmp = x - (x * (a * b))
    else if (y <= 4d+186) then
        tmp = z * (x * -a)
    else if (y <= 9.5d+229) then
        tmp = x * (y * -t)
    else
        tmp = a * (x * -z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -2.6e+70) {
		tmp = x - (t * (x * y));
	} else if (y <= 3.5e-11) {
		tmp = x - (x * (a * b));
	} else if (y <= 4e+186) {
		tmp = z * (x * -a);
	} else if (y <= 9.5e+229) {
		tmp = x * (y * -t);
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -2.6e+70:
		tmp = x - (t * (x * y))
	elif y <= 3.5e-11:
		tmp = x - (x * (a * b))
	elif y <= 4e+186:
		tmp = z * (x * -a)
	elif y <= 9.5e+229:
		tmp = x * (y * -t)
	else:
		tmp = a * (x * -z)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -2.6e+70)
		tmp = Float64(x - Float64(t * Float64(x * y)));
	elseif (y <= 3.5e-11)
		tmp = Float64(x - Float64(x * Float64(a * b)));
	elseif (y <= 4e+186)
		tmp = Float64(z * Float64(x * Float64(-a)));
	elseif (y <= 9.5e+229)
		tmp = Float64(x * Float64(y * Float64(-t)));
	else
		tmp = Float64(a * Float64(x * Float64(-z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -2.6e+70)
		tmp = x - (t * (x * y));
	elseif (y <= 3.5e-11)
		tmp = x - (x * (a * b));
	elseif (y <= 4e+186)
		tmp = z * (x * -a);
	elseif (y <= 9.5e+229)
		tmp = x * (y * -t);
	else
		tmp = a * (x * -z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.6e+70], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e-11], N[(x - N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+186], N[(z * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e+229], N[(x * N[(y * (-t)), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+70}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{-11}:\\
\;\;\;\;x - x \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;y \leq 4 \cdot 10^{+186}:\\
\;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\

\mathbf{elif}\;y \leq 9.5 \cdot 10^{+229}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -2.6e70

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 90.7%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around inf 61.6%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. mul-1-neg61.6%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out61.6%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative61.6%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    7. Simplified61.6%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    8. Taylor expanded in y around 0 30.0%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg30.0%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg30.0%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
      3. *-commutative30.0%

        \[\leadsto x - \color{blue}{\left(x \cdot y\right) \cdot t} \]
      4. associate-*l*24.9%

        \[\leadsto x - \color{blue}{x \cdot \left(y \cdot t\right)} \]
      5. *-commutative24.9%

        \[\leadsto x - x \cdot \color{blue}{\left(t \cdot y\right)} \]
    10. Simplified24.9%

      \[\leadsto \color{blue}{x - x \cdot \left(t \cdot y\right)} \]
    11. Taylor expanded in x around 0 30.0%

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

    if -2.6e70 < y < 3.50000000000000019e-11

    1. Initial program 95.3%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 80.7%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in z around 0 77.6%

      \[\leadsto \color{blue}{x \cdot e^{-1 \cdot \left(a \cdot b\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg77.6%

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. *-commutative77.6%

        \[\leadsto x \cdot e^{-\color{blue}{b \cdot a}} \]
      3. distribute-rgt-neg-in77.6%

        \[\leadsto x \cdot e^{\color{blue}{b \cdot \left(-a\right)}} \]
    5. Simplified77.6%

      \[\leadsto \color{blue}{x \cdot e^{b \cdot \left(-a\right)}} \]
    6. Taylor expanded in b around 0 44.3%

      \[\leadsto \color{blue}{x + -1 \cdot \left(a \cdot \left(b \cdot x\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg44.3%

        \[\leadsto x + \color{blue}{\left(-a \cdot \left(b \cdot x\right)\right)} \]
      2. unsub-neg44.3%

        \[\leadsto \color{blue}{x - a \cdot \left(b \cdot x\right)} \]
      3. associate-*r*46.6%

        \[\leadsto x - \color{blue}{\left(a \cdot b\right) \cdot x} \]
      4. *-commutative46.6%

        \[\leadsto x - \color{blue}{x \cdot \left(a \cdot b\right)} \]
    8. Simplified46.6%

      \[\leadsto \color{blue}{x - x \cdot \left(a \cdot b\right)} \]

    if 3.50000000000000019e-11 < y < 3.99999999999999992e186

    1. Initial program 97.7%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 40.5%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in b around 0 6.1%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    4. Taylor expanded in z around 0 6.2%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg6.2%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot z\right)}\right) \]
      2. unsub-neg6.2%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    6. Simplified6.2%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    7. Taylor expanded in a around inf 30.9%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg30.9%

        \[\leadsto \color{blue}{-a \cdot \left(x \cdot z\right)} \]
      2. associate-*r*33.0%

        \[\leadsto -\color{blue}{\left(a \cdot x\right) \cdot z} \]
    9. Simplified33.0%

      \[\leadsto \color{blue}{-\left(a \cdot x\right) \cdot z} \]

    if 3.99999999999999992e186 < y < 9.5e229

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-def100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Taylor expanded in a around 0 100.0%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    5. Taylor expanded in t around inf 74.3%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. mul-1-neg74.3%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out74.3%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative74.3%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    7. Simplified74.3%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    8. Taylor expanded in y around 0 35.5%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg35.5%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg35.5%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
      3. *-commutative35.5%

        \[\leadsto x - \color{blue}{\left(x \cdot y\right) \cdot t} \]
      4. associate-*l*42.0%

        \[\leadsto x - \color{blue}{x \cdot \left(y \cdot t\right)} \]
      5. *-commutative42.0%

        \[\leadsto x - x \cdot \color{blue}{\left(t \cdot y\right)} \]
    10. Simplified42.0%

      \[\leadsto \color{blue}{x - x \cdot \left(t \cdot y\right)} \]
    11. Taylor expanded in t around inf 41.6%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    12. Step-by-step derivation
      1. mul-1-neg41.6%

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. associate-*r*41.6%

        \[\leadsto -\color{blue}{\left(t \cdot x\right) \cdot y} \]
      3. *-commutative41.6%

        \[\leadsto -\color{blue}{\left(x \cdot t\right)} \cdot y \]
      4. distribute-rgt-neg-in41.6%

        \[\leadsto \color{blue}{\left(x \cdot t\right) \cdot \left(-y\right)} \]
      5. associate-*r*48.0%

        \[\leadsto \color{blue}{x \cdot \left(t \cdot \left(-y\right)\right)} \]
    13. Simplified48.0%

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

    if 9.5e229 < y

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 27.3%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in b around 0 3.8%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    4. Taylor expanded in z around 0 3.8%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg3.8%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot z\right)}\right) \]
      2. unsub-neg3.8%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    6. Simplified3.8%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    7. Taylor expanded in a around inf 32.3%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg32.3%

        \[\leadsto \color{blue}{-a \cdot \left(x \cdot z\right)} \]
      2. *-commutative32.3%

        \[\leadsto -\color{blue}{\left(x \cdot z\right) \cdot a} \]
      3. distribute-rgt-neg-in32.3%

        \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(-a\right)} \]
    9. Simplified32.3%

      \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(-a\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification39.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{+70}:\\ \;\;\;\;x - t \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-11}:\\ \;\;\;\;x - x \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+186}:\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+229}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \]

Alternative 15: 28.0% accurate, 31.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-11} \lor \neg \left(y \leq 1.8 \cdot 10^{-11}\right):\\
\;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.8e-11 or 1.79999999999999992e-11 < y

    1. Initial program 99.3%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 37.0%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in b around 0 4.7%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    4. Taylor expanded in z around 0 4.6%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg4.6%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot z\right)}\right) \]
      2. unsub-neg4.6%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    6. Simplified4.6%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot z\right)} \]
    7. Taylor expanded in a around inf 21.9%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg21.9%

        \[\leadsto \color{blue}{-a \cdot \left(x \cdot z\right)} \]
      2. associate-*r*23.5%

        \[\leadsto -\color{blue}{\left(a \cdot x\right) \cdot z} \]
    9. Simplified23.5%

      \[\leadsto \color{blue}{-\left(a \cdot x\right) \cdot z} \]

    if -2.8e-11 < y < 1.79999999999999992e-11

    1. Initial program 94.8%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Taylor expanded in y around 0 84.3%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Taylor expanded in a around 0 37.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.8 \cdot 10^{-11} \lor \neg \left(y \leq 1.8 \cdot 10^{-11}\right):\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 16: 20.0% accurate, 315.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
real(8) function code(x, y, z, t, a, b)
    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
    code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
def code(x, y, z, t, a, b):
	return x
function code(x, y, z, t, a, b)
	return x
end
function tmp = code(x, y, z, t, a, b)
	tmp = x;
end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 97.3%

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Taylor expanded in y around 0 57.7%

    \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
  3. Taylor expanded in a around 0 18.5%

    \[\leadsto \color{blue}{x} \]
  4. Final simplification18.5%

    \[\leadsto x \]

Reproduce

?
herbie shell --seed 2023320 
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"
  :precision binary64
  (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))