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

Percentage Accurate: 96.7% → 99.7%
Time: 19.0s
Alternatives: 17
Speedup: 1.0×

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 17 alternatives:

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

Initial Program: 96.7% 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.7% accurate, 0.8× speedup?

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

\\
x \cdot e^{\mathsf{fma}\left(a, \mathsf{log1p}\left(-z\right) - b, y \cdot \left(\log z - t\right)\right)}
\end{array}
Derivation
  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. Step-by-step derivation
    1. +-commutative97.7%

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

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

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

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

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

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

Alternative 2: 96.7% 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}
Derivation
  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. Final simplification97.7%

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

Alternative 3: 85.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.05 \cdot 10^{-156} \lor \neg \left(y \leq 3.9 \cdot 10^{-44}\right):\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= y -1.05e-156) (not (<= y 3.9e-44)))
   (* 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.05e-156) || !(y <= 3.9e-44)) {
		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.05d-156)) .or. (.not. (y <= 3.9d-44))) 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.05e-156) || !(y <= 3.9e-44)) {
		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.05e-156) or not (y <= 3.9e-44):
		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.05e-156) || !(y <= 3.9e-44))
		tmp = Float64(x * exp(Float64(y * Float64(log(z) - t))));
	else
		tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((y <= -1.05e-156) || ~((y <= 3.9e-44)))
		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.05e-156], N[Not[LessEqual[y, 3.9e-44]], $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.05 \cdot 10^{-156} \lor \neg \left(y \leq 3.9 \cdot 10^{-44}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.05000000000000006e-156 or 3.9000000000000002e-44 < y

    1. Initial program 98.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 inf 83.5%

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

    if -1.05000000000000006e-156 < y < 3.9000000000000002e-44

    1. Initial program 96.2%

      \[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 89.9%

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

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

        \[\leadsto x \cdot e^{\left(\log \left(1 + \color{blue}{-1 \cdot z}\right) - b\right) \cdot a} \]
      3. log1p-def93.7%

        \[\leadsto x \cdot e^{\left(\color{blue}{\mathsf{log1p}\left(-1 \cdot z\right)} - b\right) \cdot a} \]
      4. neg-mul-193.7%

        \[\leadsto x \cdot e^{\left(\mathsf{log1p}\left(\color{blue}{-z}\right) - b\right) \cdot a} \]
    4. Simplified93.7%

      \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{log1p}\left(-z\right) - b\right) \cdot a}} \]
    5. Taylor expanded in z around 0 93.7%

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

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

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot z + \color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      3. distribute-lft-out93.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.05 \cdot 10^{-156} \lor \neg \left(y \leq 3.9 \cdot 10^{-44}\right):\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \end{array} \]

Alternative 4: 72.1% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.8 \lor \neg \left(y \leq 1.8 \cdot 10^{+60}\right) \land \left(y \leq 2.2 \cdot 10^{+142} \lor \neg \left(y \leq 1.9 \cdot 10^{+172}\right)\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{-a \cdot b}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= y -3.8)
         (and (not (<= y 1.8e+60)) (or (<= y 2.2e+142) (not (<= y 1.9e+172)))))
   (* 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.8) || (!(y <= 1.8e+60) && ((y <= 2.2e+142) || !(y <= 1.9e+172)))) {
		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.8d0)) .or. (.not. (y <= 1.8d+60)) .and. (y <= 2.2d+142) .or. (.not. (y <= 1.9d+172))) 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.8) || (!(y <= 1.8e+60) && ((y <= 2.2e+142) || !(y <= 1.9e+172)))) {
		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.8) or (not (y <= 1.8e+60) and ((y <= 2.2e+142) or not (y <= 1.9e+172))):
		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.8) || (!(y <= 1.8e+60) && ((y <= 2.2e+142) || !(y <= 1.9e+172))))
		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.8) || (~((y <= 1.8e+60)) && ((y <= 2.2e+142) || ~((y <= 1.9e+172)))))
		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.8], And[N[Not[LessEqual[y, 1.8e+60]], $MachinePrecision], Or[LessEqual[y, 2.2e+142], N[Not[LessEqual[y, 1.9e+172]], $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.8 \lor \neg \left(y \leq 1.8 \cdot 10^{+60}\right) \land \left(y \leq 2.2 \cdot 10^{+142} \lor \neg \left(y \leq 1.9 \cdot 10^{+172}\right)\right):\\
\;\;\;\;x \cdot {z}^{y}\\

\mathbf{else}:\\
\;\;\;\;x \cdot e^{-a \cdot b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.7999999999999998 or 1.79999999999999984e60 < y < 2.19999999999999987e142 or 1.89999999999999985e172 < y

    1. Initial program 97.5%

      \[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 inf 87.5%

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

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

    if -3.7999999999999998 < y < 1.79999999999999984e60 or 2.19999999999999987e142 < y < 1.89999999999999985e172

    1. Initial program 97.9%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      2. *-commutative78.4%

        \[\leadsto x \cdot e^{\color{blue}{b \cdot \left(-1 \cdot a\right)}} \]
      3. neg-mul-178.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.8 \lor \neg \left(y \leq 1.8 \cdot 10^{+60}\right) \land \left(y \leq 2.2 \cdot 10^{+142} \lor \neg \left(y \leq 1.9 \cdot 10^{+172}\right)\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{-a \cdot b}\\ \end{array} \]

Alternative 5: 72.0% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot {z}^{y}\\ \mathbf{if}\;y \leq -220:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{-43}:\\ \;\;\;\;x \cdot e^{-a \cdot b}\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+181} \lor \neg \left(y \leq 4.3 \cdot 10^{+250}\right):\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (pow z y))))
   (if (<= y -220.0)
     t_1
     (if (<= y 2.3e-43)
       (* x (exp (- (* a b))))
       (if (or (<= y 6e+181) (not (<= y 4.3e+250)))
         (* x (exp (* t (- y))))
         t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * pow(z, y);
	double tmp;
	if (y <= -220.0) {
		tmp = t_1;
	} else if (y <= 2.3e-43) {
		tmp = x * exp(-(a * b));
	} else if ((y <= 6e+181) || !(y <= 4.3e+250)) {
		tmp = x * exp((t * -y));
	} 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 * (z ** y)
    if (y <= (-220.0d0)) then
        tmp = t_1
    else if (y <= 2.3d-43) then
        tmp = x * exp(-(a * b))
    else if ((y <= 6d+181) .or. (.not. (y <= 4.3d+250))) then
        tmp = x * exp((t * -y))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * Math.pow(z, y);
	double tmp;
	if (y <= -220.0) {
		tmp = t_1;
	} else if (y <= 2.3e-43) {
		tmp = x * Math.exp(-(a * b));
	} else if ((y <= 6e+181) || !(y <= 4.3e+250)) {
		tmp = x * Math.exp((t * -y));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.pow(z, y)
	tmp = 0
	if y <= -220.0:
		tmp = t_1
	elif y <= 2.3e-43:
		tmp = x * math.exp(-(a * b))
	elif (y <= 6e+181) or not (y <= 4.3e+250):
		tmp = x * math.exp((t * -y))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * (z ^ y))
	tmp = 0.0
	if (y <= -220.0)
		tmp = t_1;
	elseif (y <= 2.3e-43)
		tmp = Float64(x * exp(Float64(-Float64(a * b))));
	elseif ((y <= 6e+181) || !(y <= 4.3e+250))
		tmp = Float64(x * exp(Float64(t * Float64(-y))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * (z ^ y);
	tmp = 0.0;
	if (y <= -220.0)
		tmp = t_1;
	elseif (y <= 2.3e-43)
		tmp = x * exp(-(a * b));
	elseif ((y <= 6e+181) || ~((y <= 4.3e+250)))
		tmp = x * exp((t * -y));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -220.0], t$95$1, If[LessEqual[y, 2.3e-43], N[(x * N[Exp[(-N[(a * b), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 6e+181], N[Not[LessEqual[y, 4.3e+250]], $MachinePrecision]], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -220:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.3 \cdot 10^{-43}:\\
\;\;\;\;x \cdot e^{-a \cdot b}\\

\mathbf{elif}\;y \leq 6 \cdot 10^{+181} \lor \neg \left(y \leq 4.3 \cdot 10^{+250}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -220 or 6.00000000000000024e181 < y < 4.3e250

    1. Initial program 97.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 inf 87.0%

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

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

    if -220 < y < 2.2999999999999999e-43

    1. Initial program 97.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 b around inf 82.0%

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      2. *-commutative82.0%

        \[\leadsto x \cdot e^{\color{blue}{b \cdot \left(-1 \cdot a\right)}} \]
      3. neg-mul-182.0%

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

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

    if 2.2999999999999999e-43 < y < 6.00000000000000024e181 or 4.3e250 < 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 t around inf 74.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -220:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{-43}:\\ \;\;\;\;x \cdot e^{-a \cdot b}\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+181} \lor \neg \left(y \leq 4.3 \cdot 10^{+250}\right):\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \]

Alternative 6: 74.9% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -23500000000000:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 9 \cdot 10^{+181} \lor \neg \left(y \leq 9 \cdot 10^{+249}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.35e13 or 9e181 < y < 8.9999999999999993e249

    1. Initial program 97.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 inf 86.8%

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

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

    if -2.35e13 < y < 2.7999999999999998e-43

    1. Initial program 97.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 81.3%

      \[\leadsto x \cdot e^{\color{blue}{\left(\log \left(1 - z\right) - b\right) \cdot a}} \]
    3. Step-by-step derivation
      1. sub-neg81.3%

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

        \[\leadsto x \cdot e^{\left(\log \left(1 + \color{blue}{-1 \cdot z}\right) - b\right) \cdot a} \]
      3. log1p-def85.6%

        \[\leadsto x \cdot e^{\left(\color{blue}{\mathsf{log1p}\left(-1 \cdot z\right)} - b\right) \cdot a} \]
      4. neg-mul-185.6%

        \[\leadsto x \cdot e^{\left(\mathsf{log1p}\left(\color{blue}{-z}\right) - b\right) \cdot a} \]
    4. Simplified85.6%

      \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{log1p}\left(-z\right) - b\right) \cdot a}} \]
    5. Taylor expanded in z around 0 85.6%

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

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

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot z + \color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      3. distribute-lft-out85.6%

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(z + b\right)} \]
    7. Simplified85.6%

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

    if 2.7999999999999998e-43 < y < 9e181 or 8.9999999999999993e249 < 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 t around inf 74.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -23500000000000:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-43}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \mathbf{elif}\;y \leq 9 \cdot 10^{+181} \lor \neg \left(y \leq 9 \cdot 10^{+249}\right):\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \]

Alternative 7: 53.5% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -7000000000000:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;t \leq 4 \cdot 10^{+184} \lor \neg \left(t \leq 1.6 \cdot 10^{+236}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \left(y \cdot y\right) \cdot \left(t \cdot t\right)}{\frac{y \cdot t + 1}{x}}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -7000000000000.0)
   (* x (- 1.0 (* y t)))
   (if (or (<= t 4e+184) (not (<= t 1.6e+236)))
     (* x (pow z y))
     (/ (- 1.0 (* (* y y) (* t t))) (/ (+ (* y t) 1.0) x)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -7000000000000.0) {
		tmp = x * (1.0 - (y * t));
	} else if ((t <= 4e+184) || !(t <= 1.6e+236)) {
		tmp = x * pow(z, y);
	} else {
		tmp = (1.0 - ((y * y) * (t * t))) / (((y * t) + 1.0) / 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 (t <= (-7000000000000.0d0)) then
        tmp = x * (1.0d0 - (y * t))
    else if ((t <= 4d+184) .or. (.not. (t <= 1.6d+236))) then
        tmp = x * (z ** y)
    else
        tmp = (1.0d0 - ((y * y) * (t * t))) / (((y * t) + 1.0d0) / 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 (t <= -7000000000000.0) {
		tmp = x * (1.0 - (y * t));
	} else if ((t <= 4e+184) || !(t <= 1.6e+236)) {
		tmp = x * Math.pow(z, y);
	} else {
		tmp = (1.0 - ((y * y) * (t * t))) / (((y * t) + 1.0) / x);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if t <= -7000000000000.0:
		tmp = x * (1.0 - (y * t))
	elif (t <= 4e+184) or not (t <= 1.6e+236):
		tmp = x * math.pow(z, y)
	else:
		tmp = (1.0 - ((y * y) * (t * t))) / (((y * t) + 1.0) / x)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -7000000000000.0)
		tmp = Float64(x * Float64(1.0 - Float64(y * t)));
	elseif ((t <= 4e+184) || !(t <= 1.6e+236))
		tmp = Float64(x * (z ^ y));
	else
		tmp = Float64(Float64(1.0 - Float64(Float64(y * y) * Float64(t * t))) / Float64(Float64(Float64(y * t) + 1.0) / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (t <= -7000000000000.0)
		tmp = x * (1.0 - (y * t));
	elseif ((t <= 4e+184) || ~((t <= 1.6e+236)))
		tmp = x * (z ^ y);
	else
		tmp = (1.0 - ((y * y) * (t * t))) / (((y * t) + 1.0) / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -7000000000000.0], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 4e+184], N[Not[LessEqual[t, 1.6e+236]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(y * y), $MachinePrecision] * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * t), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 4 \cdot 10^{+184} \lor \neg \left(t \leq 1.6 \cdot 10^{+236}\right):\\
\;\;\;\;x \cdot {z}^{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - \left(y \cdot y\right) \cdot \left(t \cdot t\right)}{\frac{y \cdot t + 1}{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7e12

    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 t around inf 84.1%

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

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

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

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

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

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

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

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

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

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

    if -7e12 < t < 4.00000000000000007e184 or 1.6000000000000001e236 < t

    1. Initial program 97.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 inf 66.9%

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

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

    if 4.00000000000000007e184 < t < 1.6000000000000001e236

    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 t around inf 83.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(1 - t \cdot y\right)} \]
    8. Step-by-step derivation
      1. distribute-rgt-out--4.2%

        \[\leadsto \color{blue}{1 \cdot x - \left(t \cdot y\right) \cdot x} \]
      2. *-un-lft-identity4.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(-y \cdot \left(t \cdot x\right)\right) \cdot \left(-y \cdot \left(t \cdot x\right)\right)}{x - \left(-y \cdot \left(t \cdot x\right)\right)}} \]
      7. distribute-rgt-neg-in18.5%

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

        \[\leadsto \frac{x \cdot x - \left(y \cdot \left(-\color{blue}{x \cdot t}\right)\right) \cdot \left(-y \cdot \left(t \cdot x\right)\right)}{x - \left(-y \cdot \left(t \cdot x\right)\right)} \]
      9. distribute-rgt-neg-in18.5%

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

        \[\leadsto \frac{x \cdot x - \left(y \cdot \left(-x \cdot t\right)\right) \cdot \left(y \cdot \left(-\color{blue}{x \cdot t}\right)\right)}{x - \left(-y \cdot \left(t \cdot x\right)\right)} \]
      11. distribute-rgt-neg-in18.5%

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

        \[\leadsto \frac{x \cdot x - \left(y \cdot \left(-x \cdot t\right)\right) \cdot \left(y \cdot \left(-x \cdot t\right)\right)}{x - y \cdot \left(-\color{blue}{x \cdot t}\right)} \]
    9. Applied egg-rr18.5%

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

      \[\leadsto \color{blue}{\frac{\left(1 - {y}^{2} \cdot {t}^{2}\right) \cdot x}{1 - -1 \cdot \left(y \cdot t\right)}} \]
    11. Step-by-step derivation
      1. associate-/l*83.3%

        \[\leadsto \color{blue}{\frac{1 - {y}^{2} \cdot {t}^{2}}{\frac{1 - -1 \cdot \left(y \cdot t\right)}{x}}} \]
      2. sub-neg83.3%

        \[\leadsto \frac{1 - {y}^{2} \cdot {t}^{2}}{\frac{\color{blue}{1 + \left(--1 \cdot \left(y \cdot t\right)\right)}}{x}} \]
      3. mul-1-neg83.3%

        \[\leadsto \frac{1 - {y}^{2} \cdot {t}^{2}}{\frac{1 + \left(-\color{blue}{\left(-y \cdot t\right)}\right)}{x}} \]
      4. *-commutative83.3%

        \[\leadsto \frac{1 - {y}^{2} \cdot {t}^{2}}{\frac{1 + \left(-\left(-\color{blue}{t \cdot y}\right)\right)}{x}} \]
      5. remove-double-neg83.3%

        \[\leadsto \frac{1 - {y}^{2} \cdot {t}^{2}}{\frac{1 + \color{blue}{t \cdot y}}{x}} \]
      6. *-commutative83.3%

        \[\leadsto \frac{1 - {y}^{2} \cdot {t}^{2}}{\frac{1 + \color{blue}{y \cdot t}}{x}} \]
      7. unpow283.3%

        \[\leadsto \frac{1 - \color{blue}{\left(y \cdot y\right)} \cdot {t}^{2}}{\frac{1 + y \cdot t}{x}} \]
      8. unpow283.3%

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

        \[\leadsto \frac{1 - \left(y \cdot y\right) \cdot \left(t \cdot t\right)}{\frac{1 + \color{blue}{t \cdot y}}{x}} \]
      10. *-lft-identity83.3%

        \[\leadsto \frac{1 - \left(y \cdot y\right) \cdot \left(t \cdot t\right)}{\frac{1 + \color{blue}{1 \cdot \left(t \cdot y\right)}}{x}} \]
      11. metadata-eval83.3%

        \[\leadsto \frac{1 - \left(y \cdot y\right) \cdot \left(t \cdot t\right)}{\frac{1 + \color{blue}{\left(--1\right)} \cdot \left(t \cdot y\right)}{x}} \]
      12. *-commutative83.3%

        \[\leadsto \frac{1 - \left(y \cdot y\right) \cdot \left(t \cdot t\right)}{\frac{1 + \left(--1\right) \cdot \color{blue}{\left(y \cdot t\right)}}{x}} \]
      13. cancel-sign-sub-inv83.3%

        \[\leadsto \frac{1 - \left(y \cdot y\right) \cdot \left(t \cdot t\right)}{\frac{\color{blue}{1 - -1 \cdot \left(y \cdot t\right)}}{x}} \]
      14. mul-1-neg83.3%

        \[\leadsto \frac{1 - \left(y \cdot y\right) \cdot \left(t \cdot t\right)}{\frac{1 - \color{blue}{\left(-y \cdot t\right)}}{x}} \]
    12. Simplified83.3%

      \[\leadsto \color{blue}{\frac{1 - \left(y \cdot y\right) \cdot \left(t \cdot t\right)}{\frac{1 - \left(-y \cdot t\right)}{x}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification56.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7000000000000:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;t \leq 4 \cdot 10^{+184} \lor \neg \left(t \leq 1.6 \cdot 10^{+236}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \left(y \cdot y\right) \cdot \left(t \cdot t\right)}{\frac{y \cdot t + 1}{x}}\\ \end{array} \]

Alternative 8: 30.9% accurate, 11.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \left(x \cdot t\right)\\ t_2 := \frac{x \cdot x}{t_1}\\ \mathbf{if}\;b \leq -260000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 9 \cdot 10^{-14}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;b \leq 1.16 \cdot 10^{+70}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 1.15 \cdot 10^{+280}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(y \cdot y\right) \cdot \left(\left(t \cdot t\right) \cdot \left(-x \cdot x\right)\right)}{t_1}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* y (* x t)))) (t_2 (/ (* x x) t_1)))
   (if (<= b -260000000.0)
     t_2
     (if (<= b 9e-14)
       (* x (- 1.0 (* y t)))
       (if (<= b 1.16e+70)
         t_2
         (if (<= b 1.15e+280)
           (* x (- 1.0 (* a b)))
           (/ (* (* y y) (* (* t t) (- (* x x)))) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (y * (x * t));
	double t_2 = (x * x) / t_1;
	double tmp;
	if (b <= -260000000.0) {
		tmp = t_2;
	} else if (b <= 9e-14) {
		tmp = x * (1.0 - (y * t));
	} else if (b <= 1.16e+70) {
		tmp = t_2;
	} else if (b <= 1.15e+280) {
		tmp = x * (1.0 - (a * b));
	} else {
		tmp = ((y * y) * ((t * t) * -(x * x))) / 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) :: t_2
    real(8) :: tmp
    t_1 = x + (y * (x * t))
    t_2 = (x * x) / t_1
    if (b <= (-260000000.0d0)) then
        tmp = t_2
    else if (b <= 9d-14) then
        tmp = x * (1.0d0 - (y * t))
    else if (b <= 1.16d+70) then
        tmp = t_2
    else if (b <= 1.15d+280) then
        tmp = x * (1.0d0 - (a * b))
    else
        tmp = ((y * y) * ((t * t) * -(x * x))) / 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 * (x * t));
	double t_2 = (x * x) / t_1;
	double tmp;
	if (b <= -260000000.0) {
		tmp = t_2;
	} else if (b <= 9e-14) {
		tmp = x * (1.0 - (y * t));
	} else if (b <= 1.16e+70) {
		tmp = t_2;
	} else if (b <= 1.15e+280) {
		tmp = x * (1.0 - (a * b));
	} else {
		tmp = ((y * y) * ((t * t) * -(x * x))) / t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (y * (x * t))
	t_2 = (x * x) / t_1
	tmp = 0
	if b <= -260000000.0:
		tmp = t_2
	elif b <= 9e-14:
		tmp = x * (1.0 - (y * t))
	elif b <= 1.16e+70:
		tmp = t_2
	elif b <= 1.15e+280:
		tmp = x * (1.0 - (a * b))
	else:
		tmp = ((y * y) * ((t * t) * -(x * x))) / t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(y * Float64(x * t)))
	t_2 = Float64(Float64(x * x) / t_1)
	tmp = 0.0
	if (b <= -260000000.0)
		tmp = t_2;
	elseif (b <= 9e-14)
		tmp = Float64(x * Float64(1.0 - Float64(y * t)));
	elseif (b <= 1.16e+70)
		tmp = t_2;
	elseif (b <= 1.15e+280)
		tmp = Float64(x * Float64(1.0 - Float64(a * b)));
	else
		tmp = Float64(Float64(Float64(y * y) * Float64(Float64(t * t) * Float64(-Float64(x * x)))) / t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (y * (x * t));
	t_2 = (x * x) / t_1;
	tmp = 0.0;
	if (b <= -260000000.0)
		tmp = t_2;
	elseif (b <= 9e-14)
		tmp = x * (1.0 - (y * t));
	elseif (b <= 1.16e+70)
		tmp = t_2;
	elseif (b <= 1.15e+280)
		tmp = x * (1.0 - (a * b));
	else
		tmp = ((y * y) * ((t * t) * -(x * x))) / t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * x), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[b, -260000000.0], t$95$2, If[LessEqual[b, 9e-14], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.16e+70], t$95$2, If[LessEqual[b, 1.15e+280], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * y), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * (-N[(x * x), $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + y \cdot \left(x \cdot t\right)\\
t_2 := \frac{x \cdot x}{t_1}\\
\mathbf{if}\;b \leq -260000000:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \leq 9 \cdot 10^{-14}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\

\mathbf{elif}\;b \leq 1.16 \cdot 10^{+70}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \leq 1.15 \cdot 10^{+280}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -2.6e8 or 8.9999999999999995e-14 < b < 1.1599999999999999e70

    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 t around inf 43.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(1 - t \cdot y\right)} \]
    8. Step-by-step derivation
      1. distribute-rgt-out--16.5%

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

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

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

        \[\leadsto x - \color{blue}{y \cdot \left(t \cdot x\right)} \]
      5. sub-neg17.6%

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(-y \cdot \left(t \cdot x\right)\right) \cdot \left(-y \cdot \left(t \cdot x\right)\right)}{x - \left(-y \cdot \left(t \cdot x\right)\right)}} \]
      7. distribute-rgt-neg-in21.2%

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

        \[\leadsto \frac{x \cdot x - \left(y \cdot \left(-\color{blue}{x \cdot t}\right)\right) \cdot \left(-y \cdot \left(t \cdot x\right)\right)}{x - \left(-y \cdot \left(t \cdot x\right)\right)} \]
      9. distribute-rgt-neg-in21.2%

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

        \[\leadsto \frac{x \cdot x - \left(y \cdot \left(-x \cdot t\right)\right) \cdot \left(y \cdot \left(-\color{blue}{x \cdot t}\right)\right)}{x - \left(-y \cdot \left(t \cdot x\right)\right)} \]
      11. distribute-rgt-neg-in21.2%

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

        \[\leadsto \frac{x \cdot x - \left(y \cdot \left(-x \cdot t\right)\right) \cdot \left(y \cdot \left(-x \cdot t\right)\right)}{x - y \cdot \left(-\color{blue}{x \cdot t}\right)} \]
    9. Applied egg-rr21.2%

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

      \[\leadsto \frac{\color{blue}{{x}^{2}}}{x - y \cdot \left(-x \cdot t\right)} \]
    11. Step-by-step derivation
      1. unpow237.4%

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

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

    if -2.6e8 < b < 8.9999999999999995e-14

    1. Initial program 96.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 t around inf 71.0%

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

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

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

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

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

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

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

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

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

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

    if 1.1599999999999999e70 < b < 1.15e280

    1. Initial program 97.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 b around inf 77.1%

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

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

        \[\leadsto x \cdot e^{\color{blue}{b \cdot \left(-1 \cdot a\right)}} \]
      3. neg-mul-177.1%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
      3. *-commutative33.7%

        \[\leadsto x \cdot \left(1 - \color{blue}{b \cdot a}\right) \]
    7. Simplified33.7%

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

    if 1.15e280 < b

    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 t around inf 26.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(1 - t \cdot y\right)} \]
    8. Step-by-step derivation
      1. distribute-rgt-out--4.7%

        \[\leadsto \color{blue}{1 \cdot x - \left(t \cdot y\right) \cdot x} \]
      2. *-un-lft-identity4.7%

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

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

        \[\leadsto x - \color{blue}{y \cdot \left(t \cdot x\right)} \]
      5. sub-neg4.7%

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(-y \cdot \left(t \cdot x\right)\right) \cdot \left(-y \cdot \left(t \cdot x\right)\right)}{x - \left(-y \cdot \left(t \cdot x\right)\right)}} \]
      7. distribute-rgt-neg-in46.1%

        \[\leadsto \frac{x \cdot x - \color{blue}{\left(y \cdot \left(-t \cdot x\right)\right)} \cdot \left(-y \cdot \left(t \cdot x\right)\right)}{x - \left(-y \cdot \left(t \cdot x\right)\right)} \]
      8. *-commutative46.1%

        \[\leadsto \frac{x \cdot x - \left(y \cdot \left(-\color{blue}{x \cdot t}\right)\right) \cdot \left(-y \cdot \left(t \cdot x\right)\right)}{x - \left(-y \cdot \left(t \cdot x\right)\right)} \]
      9. distribute-rgt-neg-in46.1%

        \[\leadsto \frac{x \cdot x - \left(y \cdot \left(-x \cdot t\right)\right) \cdot \color{blue}{\left(y \cdot \left(-t \cdot x\right)\right)}}{x - \left(-y \cdot \left(t \cdot x\right)\right)} \]
      10. *-commutative46.1%

        \[\leadsto \frac{x \cdot x - \left(y \cdot \left(-x \cdot t\right)\right) \cdot \left(y \cdot \left(-\color{blue}{x \cdot t}\right)\right)}{x - \left(-y \cdot \left(t \cdot x\right)\right)} \]
      11. distribute-rgt-neg-in46.1%

        \[\leadsto \frac{x \cdot x - \left(y \cdot \left(-x \cdot t\right)\right) \cdot \left(y \cdot \left(-x \cdot t\right)\right)}{x - \color{blue}{y \cdot \left(-t \cdot x\right)}} \]
      12. *-commutative46.1%

        \[\leadsto \frac{x \cdot x - \left(y \cdot \left(-x \cdot t\right)\right) \cdot \left(y \cdot \left(-x \cdot t\right)\right)}{x - y \cdot \left(-\color{blue}{x \cdot t}\right)} \]
    9. Applied egg-rr46.1%

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

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

        \[\leadsto \frac{\color{blue}{-{y}^{2} \cdot \left({t}^{2} \cdot {x}^{2}\right)}}{x - y \cdot \left(-x \cdot t\right)} \]
      2. unpow266.9%

        \[\leadsto \frac{-\color{blue}{\left(y \cdot y\right)} \cdot \left({t}^{2} \cdot {x}^{2}\right)}{x - y \cdot \left(-x \cdot t\right)} \]
      3. unpow266.9%

        \[\leadsto \frac{-\left(y \cdot y\right) \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot {x}^{2}\right)}{x - y \cdot \left(-x \cdot t\right)} \]
      4. unpow266.9%

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

      \[\leadsto \frac{\color{blue}{-\left(y \cdot y\right) \cdot \left(\left(t \cdot t\right) \cdot \left(x \cdot x\right)\right)}}{x - y \cdot \left(-x \cdot t\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification39.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -260000000:\\ \;\;\;\;\frac{x \cdot x}{x + y \cdot \left(x \cdot t\right)}\\ \mathbf{elif}\;b \leq 9 \cdot 10^{-14}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;b \leq 1.16 \cdot 10^{+70}:\\ \;\;\;\;\frac{x \cdot x}{x + y \cdot \left(x \cdot t\right)}\\ \mathbf{elif}\;b \leq 1.15 \cdot 10^{+280}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(y \cdot y\right) \cdot \left(\left(t \cdot t\right) \cdot \left(-x \cdot x\right)\right)}{x + y \cdot \left(x \cdot t\right)}\\ \end{array} \]

Alternative 9: 31.2% accurate, 16.4× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x \cdot x}{x + y \cdot \left(x \cdot t\right)}\\
\mathbf{if}\;b \leq -26000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 2.3 \cdot 10^{-13}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\

\mathbf{elif}\;b \leq 8 \cdot 10^{+66} \lor \neg \left(b \leq 1.95 \cdot 10^{+277}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -2.6e7 or 2.29999999999999979e-13 < b < 7.99999999999999956e66 or 1.95000000000000002e277 < b

    1. Initial program 98.9%

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(y \cdot t\right)\right)} \]
      2. mul-1-neg15.4%

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(1 - t \cdot y\right)} \]
    8. Step-by-step derivation
      1. distribute-rgt-out--15.4%

        \[\leadsto \color{blue}{1 \cdot x - \left(t \cdot y\right) \cdot x} \]
      2. *-un-lft-identity15.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot x - \left(y \cdot \left(-x \cdot t\right)\right) \cdot \left(y \cdot \left(-x \cdot t\right)\right)}{x - y \cdot \left(-\color{blue}{x \cdot t}\right)} \]
    9. Applied egg-rr23.6%

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

      \[\leadsto \frac{\color{blue}{{x}^{2}}}{x - y \cdot \left(-x \cdot t\right)} \]
    11. Step-by-step derivation
      1. unpow239.3%

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

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

    if -2.6e7 < b < 2.29999999999999979e-13

    1. Initial program 96.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 t around inf 71.0%

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

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

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

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

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

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

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

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

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

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

    if 7.99999999999999956e66 < b < 1.95000000000000002e277

    1. Initial program 97.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 b around inf 77.1%

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

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

        \[\leadsto x \cdot e^{\color{blue}{b \cdot \left(-1 \cdot a\right)}} \]
      3. neg-mul-177.1%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
      3. *-commutative33.7%

        \[\leadsto x \cdot \left(1 - \color{blue}{b \cdot a}\right) \]
    7. Simplified33.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -26000000:\\ \;\;\;\;\frac{x \cdot x}{x + y \cdot \left(x \cdot t\right)}\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{-13}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;b \leq 8 \cdot 10^{+66} \lor \neg \left(b \leq 1.95 \cdot 10^{+277}\right):\\ \;\;\;\;\frac{x \cdot x}{x + y \cdot \left(x \cdot t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \end{array} \]

Alternative 10: 29.2% accurate, 23.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+246}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{-199} \lor \neg \left(x \leq 1.22 \cdot 10^{-63}\right):\\ \;\;\;\;x \cdot \left(1 - a \cdot b\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 (<= x -6.5e+246)
   (* x (* t (- y)))
   (if (or (<= x -1.5e-199) (not (<= x 1.22e-63)))
     (* x (- 1.0 (* a b)))
     (* a (* x (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -6.5e+246) {
		tmp = x * (t * -y);
	} else if ((x <= -1.5e-199) || !(x <= 1.22e-63)) {
		tmp = x * (1.0 - (a * b));
	} 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 <= (-6.5d+246)) then
        tmp = x * (t * -y)
    else if ((x <= (-1.5d-199)) .or. (.not. (x <= 1.22d-63))) then
        tmp = x * (1.0d0 - (a * b))
    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 <= -6.5e+246) {
		tmp = x * (t * -y);
	} else if ((x <= -1.5e-199) || !(x <= 1.22e-63)) {
		tmp = x * (1.0 - (a * b));
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -6.5e+246:
		tmp = x * (t * -y)
	elif (x <= -1.5e-199) or not (x <= 1.22e-63):
		tmp = x * (1.0 - (a * b))
	else:
		tmp = a * (x * -z)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -6.5e+246)
		tmp = Float64(x * Float64(t * Float64(-y)));
	elseif ((x <= -1.5e-199) || !(x <= 1.22e-63))
		tmp = Float64(x * Float64(1.0 - Float64(a * b)));
	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 <= -6.5e+246)
		tmp = x * (t * -y);
	elseif ((x <= -1.5e-199) || ~((x <= 1.22e-63)))
		tmp = x * (1.0 - (a * b));
	else
		tmp = a * (x * -z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -6.5e+246], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -1.5e-199], N[Not[LessEqual[x, 1.22e-63]], $MachinePrecision]], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.5 \cdot 10^{-199} \lor \neg \left(x \leq 1.22 \cdot 10^{-63}\right):\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\

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


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

    1. Initial program 91.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 t around inf 75.4%

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(y \cdot t\right)\right)} \]
      2. mul-1-neg50.8%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot \left(t \cdot x\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*51.1%

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \left(t \cdot y\right)\right)} \]
      4. neg-mul-151.1%

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

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

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

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

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

    if -6.49999999999999977e246 < x < -1.49999999999999992e-199 or 1.2199999999999999e-63 < x

    1. Initial program 98.2%

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{b \cdot \left(-1 \cdot a\right)}} \]
      3. neg-mul-158.2%

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

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

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

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

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

        \[\leadsto x \cdot \left(1 - \color{blue}{b \cdot a}\right) \]
    7. Simplified33.3%

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

    if -1.49999999999999992e-199 < x < 1.2199999999999999e-63

    1. Initial program 97.5%

      \[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 58.5%

      \[\leadsto x \cdot e^{\color{blue}{\left(\log \left(1 - z\right) - b\right) \cdot a}} \]
    3. Step-by-step derivation
      1. sub-neg58.5%

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

        \[\leadsto x \cdot e^{\left(\log \left(1 + \color{blue}{-1 \cdot z}\right) - b\right) \cdot a} \]
      3. log1p-def60.9%

        \[\leadsto x \cdot e^{\left(\color{blue}{\mathsf{log1p}\left(-1 \cdot z\right)} - b\right) \cdot a} \]
      4. neg-mul-160.9%

        \[\leadsto x \cdot e^{\left(\mathsf{log1p}\left(\color{blue}{-z}\right) - b\right) \cdot a} \]
    4. Simplified60.9%

      \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{log1p}\left(-z\right) - b\right) \cdot a}} \]
    5. Taylor expanded in z around 0 60.9%

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

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

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot z + \color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      3. distribute-lft-out60.9%

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(z + b\right)} \]
    7. Simplified60.9%

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

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

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

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

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

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

        \[\leadsto x - a \cdot \left(\color{blue}{\left(b + z\right)} \cdot x\right) \]
    10. Simplified9.4%

      \[\leadsto \color{blue}{x - a \cdot \left(\left(b + z\right) \cdot x\right)} \]
    11. Taylor expanded in z around inf 35.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+246}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{-199} \lor \neg \left(x \leq 1.22 \cdot 10^{-63}\right):\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \]

Alternative 11: 31.4% accurate, 28.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -240000 \lor \neg \left(b \leq 5.2 \cdot 10^{-22}\right):\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.4e5 or 5.2e-22 < b

    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. Taylor expanded in b around inf 72.6%

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

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

        \[\leadsto x \cdot e^{\color{blue}{b \cdot \left(-1 \cdot a\right)}} \]
      3. neg-mul-172.6%

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

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

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

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

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

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

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

    if -2.4e5 < b < 5.2e-22

    1. Initial program 96.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 t around inf 70.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(1 - t \cdot y\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification34.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -240000 \lor \neg \left(b \leq 5.2 \cdot 10^{-22}\right):\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \end{array} \]

Alternative 12: 26.2% accurate, 31.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+166} \lor \neg \left(y \leq 10^{-25}\right):\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.59999999999999984e166 or 1.00000000000000004e-25 < y

    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 t around inf 64.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot \left(t \cdot x\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*28.5%

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \left(t \cdot y\right)\right)} \]
      4. neg-mul-128.5%

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

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

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

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

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

    if -1.59999999999999984e166 < y < 1.00000000000000004e-25

    1. Initial program 98.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 b around inf 72.8%

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      2. *-commutative72.8%

        \[\leadsto x \cdot e^{\color{blue}{b \cdot \left(-1 \cdot a\right)}} \]
      3. neg-mul-172.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{+166} \lor \neg \left(y \leq 10^{-25}\right):\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 13: 26.2% accurate, 31.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{+15}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\

\mathbf{elif}\;y \leq 6.2 \cdot 10^{-18}:\\
\;\;\;\;x\\

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


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

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

      \[\leadsto x \cdot e^{\color{blue}{\left(\log \left(1 - z\right) - b\right) \cdot a}} \]
    3. Step-by-step derivation
      1. sub-neg32.2%

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

        \[\leadsto x \cdot e^{\left(\log \left(1 + \color{blue}{-1 \cdot z}\right) - b\right) \cdot a} \]
      3. log1p-def29.1%

        \[\leadsto x \cdot e^{\left(\color{blue}{\mathsf{log1p}\left(-1 \cdot z\right)} - b\right) \cdot a} \]
      4. neg-mul-129.1%

        \[\leadsto x \cdot e^{\left(\mathsf{log1p}\left(\color{blue}{-z}\right) - b\right) \cdot a} \]
    4. Simplified29.1%

      \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{log1p}\left(-z\right) - b\right) \cdot a}} \]
    5. Taylor expanded in z around 0 29.1%

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(z + b\right)} \]
    7. Simplified29.1%

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

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

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

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

        \[\leadsto \color{blue}{x - a \cdot \left(x \cdot \left(z + b\right)\right)} \]
      4. *-commutative8.8%

        \[\leadsto x - a \cdot \color{blue}{\left(\left(z + b\right) \cdot x\right)} \]
      5. +-commutative8.8%

        \[\leadsto x - a \cdot \left(\color{blue}{\left(b + z\right)} \cdot x\right) \]
    10. Simplified8.8%

      \[\leadsto \color{blue}{x - a \cdot \left(\left(b + z\right) \cdot x\right)} \]
    11. Taylor expanded in z around inf 12.8%

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

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

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

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

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

    if -3.9e15 < y < 6.20000000000000014e-18

    1. Initial program 97.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 b around inf 79.4%

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      2. *-commutative79.4%

        \[\leadsto x \cdot e^{\color{blue}{b \cdot \left(-1 \cdot a\right)}} \]
      3. neg-mul-179.4%

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

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

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

    if 6.20000000000000014e-18 < y

    1. Initial program 97.2%

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{b \cdot \left(-1 \cdot a\right)}} \]
      3. neg-mul-141.5%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
      3. *-commutative16.9%

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

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

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

        \[\leadsto \color{blue}{-a \cdot \left(b \cdot x\right)} \]
      2. distribute-rgt-neg-in27.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.9 \cdot 10^{+15}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{-18}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]

Alternative 14: 26.9% accurate, 31.1× speedup?

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

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

\mathbf{elif}\;y \leq 2.3 \cdot 10^{-25}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.84999999999999994e-16

    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. Taylor expanded in t around inf 46.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot \left(t \cdot x\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*17.7%

        \[\leadsto \color{blue}{\left(-1 \cdot y\right) \cdot \left(t \cdot x\right)} \]
      2. neg-mul-117.7%

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

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

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

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

    if -3.84999999999999994e-16 < y < 2.2999999999999999e-25

    1. Initial program 97.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 b around inf 83.7%

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      2. *-commutative83.7%

        \[\leadsto x \cdot e^{\color{blue}{b \cdot \left(-1 \cdot a\right)}} \]
      3. neg-mul-183.7%

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

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

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

    if 2.2999999999999999e-25 < y

    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 t around inf 67.1%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot \left(t \cdot x\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*28.1%

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \left(t \cdot y\right)\right)} \]
      4. neg-mul-128.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.85 \cdot 10^{-16}:\\ \;\;\;\;y \cdot \left(x \cdot \left(-t\right)\right)\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{-25}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \end{array} \]

Alternative 15: 24.2% accurate, 39.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.5 \cdot 10^{-19}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.5000000000000002e-19

    1. Initial program 97.9%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      2. *-commutative62.9%

        \[\leadsto x \cdot e^{\color{blue}{b \cdot \left(-1 \cdot a\right)}} \]
      3. neg-mul-162.9%

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

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

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

    if 2.5000000000000002e-19 < y

    1. Initial program 97.2%

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{b \cdot \left(-1 \cdot a\right)}} \]
      3. neg-mul-141.5%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
      3. *-commutative16.9%

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

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

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

        \[\leadsto \color{blue}{-a \cdot \left(b \cdot x\right)} \]
      2. distribute-rgt-neg-in27.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.5 \cdot 10^{-19}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]

Alternative 16: 20.3% accurate, 44.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.95 \cdot 10^{+80}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 1.94999999999999999e80

    1. Initial program 99.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 b around inf 51.9%

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      2. *-commutative51.9%

        \[\leadsto x \cdot e^{\color{blue}{b \cdot \left(-1 \cdot a\right)}} \]
      3. neg-mul-151.9%

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

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

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

    if 1.94999999999999999e80 < a

    1. Initial program 91.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 t around inf 37.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot \left(t \cdot x\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*24.9%

        \[\leadsto \color{blue}{\left(-1 \cdot y\right) \cdot \left(t \cdot x\right)} \]
      2. neg-mul-124.9%

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

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

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

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

        \[\leadsto \color{blue}{\left(-y\right) \cdot \left(x \cdot t\right)} \]
      2. add-sqr-sqrt14.7%

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

        \[\leadsto \left(-y\right) \cdot \color{blue}{\sqrt{\left(x \cdot t\right) \cdot \left(x \cdot t\right)}} \]
      4. sqr-neg33.6%

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

        \[\leadsto \left(-y\right) \cdot \color{blue}{\left(\sqrt{-x \cdot t} \cdot \sqrt{-x \cdot t}\right)} \]
      6. add-sqr-sqrt22.7%

        \[\leadsto \left(-y\right) \cdot \color{blue}{\left(-x \cdot t\right)} \]
      7. add-sqr-sqrt7.7%

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

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

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

        \[\leadsto \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot \left(-x \cdot t\right) \]
      11. add-sqr-sqrt24.9%

        \[\leadsto \color{blue}{y} \cdot \left(-x \cdot t\right) \]
      12. expm1-log1p-u22.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(y \cdot \left(-x \cdot t\right)\right)\right)} \]
      13. expm1-udef25.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(y \cdot \left(-x \cdot t\right)\right)} - 1} \]
    12. Applied egg-rr23.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(x \cdot \left(t \cdot y\right)\right)} - 1} \]
    13. Step-by-step derivation
      1. expm1-def18.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x \cdot \left(t \cdot y\right)\right)\right)} \]
      2. expm1-log1p20.6%

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

        \[\leadsto x \cdot \color{blue}{\left(y \cdot t\right)} \]
    14. Simplified20.6%

      \[\leadsto \color{blue}{x \cdot \left(y \cdot t\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification19.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.95 \cdot 10^{+80}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot t\right)\\ \end{array} \]

Alternative 17: 18.9% 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.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 b around inf 56.9%

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

      \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
    2. *-commutative56.9%

      \[\leadsto x \cdot e^{\color{blue}{b \cdot \left(-1 \cdot a\right)}} \]
    3. neg-mul-156.9%

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification16.8%

    \[\leadsto x \]

Reproduce

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