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

Percentage Accurate: 96.6% → 99.4%
Time: 17.5s
Alternatives: 20
Speedup: 0.8×

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

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

Initial Program: 96.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(\log z - t\right)\\ \mathbf{if}\;t\_1 + a \cdot \left(\log \left(1 - z\right) - b\right) \leq \infty:\\ \;\;\;\;x \cdot e^{t\_1 - a \cdot \left(z + b\right)}\\ \mathbf{else}:\\ \;\;\;\;x + b \cdot \left(0.5 \cdot \left({a}^{2} \cdot \left(x \cdot b\right)\right) - x \cdot a\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* y (- (log z) t))))
   (if (<= (+ t_1 (* a (- (log (- 1.0 z)) b))) INFINITY)
     (* x (exp (- t_1 (* a (+ z b)))))
     (+ x (* b (- (* 0.5 (* (pow a 2.0) (* x b))) (* x a)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y * (log(z) - t);
	double tmp;
	if ((t_1 + (a * (log((1.0 - z)) - b))) <= ((double) INFINITY)) {
		tmp = x * exp((t_1 - (a * (z + b))));
	} else {
		tmp = x + (b * ((0.5 * (pow(a, 2.0) * (x * b))) - (x * a)));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y * (Math.log(z) - t);
	double tmp;
	if ((t_1 + (a * (Math.log((1.0 - z)) - b))) <= Double.POSITIVE_INFINITY) {
		tmp = x * Math.exp((t_1 - (a * (z + b))));
	} else {
		tmp = x + (b * ((0.5 * (Math.pow(a, 2.0) * (x * b))) - (x * a)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = y * (math.log(z) - t)
	tmp = 0
	if (t_1 + (a * (math.log((1.0 - z)) - b))) <= math.inf:
		tmp = x * math.exp((t_1 - (a * (z + b))))
	else:
		tmp = x + (b * ((0.5 * (math.pow(a, 2.0) * (x * b))) - (x * a)))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(y * Float64(log(z) - t))
	tmp = 0.0
	if (Float64(t_1 + Float64(a * Float64(log(Float64(1.0 - z)) - b))) <= Inf)
		tmp = Float64(x * exp(Float64(t_1 - Float64(a * Float64(z + b)))));
	else
		tmp = Float64(x + Float64(b * Float64(Float64(0.5 * Float64((a ^ 2.0) * Float64(x * b))) - Float64(x * a))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = y * (log(z) - t);
	tmp = 0.0;
	if ((t_1 + (a * (log((1.0 - z)) - b))) <= Inf)
		tmp = x * exp((t_1 - (a * (z + b))));
	else
		tmp = x + (b * ((0.5 * ((a ^ 2.0) * (x * b))) - (x * a)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x * N[Exp[N[(t$95$1 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x + N[(b * N[(N[(0.5 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \left(\log z - t\right)\\
\mathbf{if}\;t\_1 + a \cdot \left(\log \left(1 - z\right) - b\right) \leq \infty:\\
\;\;\;\;x \cdot e^{t\_1 - a \cdot \left(z + b\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < +inf.0

    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. Add Preprocessing
    3. Taylor expanded in z around 0 100.0%

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

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

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

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

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

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

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

    if +inf.0 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-lft-neg-out57.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq \infty:\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot \left(z + b\right)}\\ \mathbf{else}:\\ \;\;\;\;x + b \cdot \left(0.5 \cdot \left({a}^{2} \cdot \left(x \cdot b\right)\right) - x \cdot a\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 99.5% accurate, 0.8× speedup?

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

\\
x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}
\end{array}
Derivation
  1. Initial program 94.5%

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

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

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

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

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

Alternative 3: 85.9% accurate, 1.5× speedup?

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

\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 < -5.00000000000000018e-11 or 4.1e17 < y

    1. Initial program 94.1%

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(x \cdot e^{y \cdot \left(\log z - t\right)}\right)}^{1}} \]
      2. *-commutative87.6%

        \[\leadsto {\left(x \cdot e^{\color{blue}{\left(\log z - t\right) \cdot y}}\right)}^{1} \]
      3. exp-prod87.6%

        \[\leadsto {\left(x \cdot \color{blue}{{\left(e^{\log z - t}\right)}^{y}}\right)}^{1} \]
      4. exp-diff87.6%

        \[\leadsto {\left(x \cdot {\color{blue}{\left(\frac{e^{\log z}}{e^{t}}\right)}}^{y}\right)}^{1} \]
      5. add-exp-log87.6%

        \[\leadsto {\left(x \cdot {\left(\frac{\color{blue}{z}}{e^{t}}\right)}^{y}\right)}^{1} \]
    7. Applied egg-rr87.6%

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

        \[\leadsto \color{blue}{x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}} \]
    9. Simplified87.6%

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

    if -5.00000000000000018e-11 < y < 4.1e17

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(b + z\right)} \]
      3. *-commutative90.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{-11} \lor \neg \left(y \leq 4.1 \cdot 10^{+17}\right):\\ \;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 74.2% accurate, 2.7× speedup?

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

\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 < -0.0519999999999999976 or 4.4999999999999997e134 < y

    1. Initial program 93.6%

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

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

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

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

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

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

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

    if -0.0519999999999999976 < y < 4.4999999999999997e134

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.052 \lor \neg \left(y \leq 4.5 \cdot 10^{+134}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 74.2% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.048:\\ \;\;\;\;x \cdot {\left(\frac{z}{t + 1}\right)}^{y}\\ \mathbf{elif}\;y \leq 6.9 \cdot 10^{+134}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -0.048)
   (* x (pow (/ z (+ t 1.0)) y))
   (if (<= y 6.9e+134) (* x (exp (* a (- (- z) b)))) (* x (pow z y)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -0.048) {
		tmp = x * pow((z / (t + 1.0)), y);
	} else if (y <= 6.9e+134) {
		tmp = x * exp((a * (-z - b)));
	} else {
		tmp = x * pow(z, y);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (y <= (-0.048d0)) then
        tmp = x * ((z / (t + 1.0d0)) ** y)
    else if (y <= 6.9d+134) then
        tmp = x * exp((a * (-z - b)))
    else
        tmp = x * (z ** y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -0.048) {
		tmp = x * Math.pow((z / (t + 1.0)), y);
	} else if (y <= 6.9e+134) {
		tmp = x * Math.exp((a * (-z - b)));
	} else {
		tmp = x * Math.pow(z, y);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -0.048:
		tmp = x * math.pow((z / (t + 1.0)), y)
	elif y <= 6.9e+134:
		tmp = x * math.exp((a * (-z - b)))
	else:
		tmp = x * math.pow(z, y)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -0.048)
		tmp = Float64(x * (Float64(z / Float64(t + 1.0)) ^ y));
	elseif (y <= 6.9e+134)
		tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b))));
	else
		tmp = Float64(x * (z ^ y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -0.048)
		tmp = x * ((z / (t + 1.0)) ^ y);
	elseif (y <= 6.9e+134)
		tmp = x * exp((a * (-z - b)));
	else
		tmp = x * (z ^ y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -0.048], N[(x * N[Power[N[(z / N[(t + 1.0), $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.9e+134], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.048:\\
\;\;\;\;x \cdot {\left(\frac{z}{t + 1}\right)}^{y}\\

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

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


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

    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. Step-by-step derivation
      1. fma-define98.3%

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(x \cdot e^{y \cdot \left(\log z - t\right)}\right)}^{1}} \]
      2. *-commutative93.4%

        \[\leadsto {\left(x \cdot e^{\color{blue}{\left(\log z - t\right) \cdot y}}\right)}^{1} \]
      3. exp-prod93.4%

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

        \[\leadsto {\left(x \cdot {\color{blue}{\left(\frac{e^{\log z}}{e^{t}}\right)}}^{y}\right)}^{1} \]
      5. add-exp-log93.4%

        \[\leadsto {\left(x \cdot {\left(\frac{\color{blue}{z}}{e^{t}}\right)}^{y}\right)}^{1} \]
    7. Applied egg-rr93.4%

      \[\leadsto \color{blue}{{\left(x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\right)}^{1}} \]
    8. Step-by-step derivation
      1. unpow193.4%

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

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

      \[\leadsto x \cdot {\left(\frac{z}{\color{blue}{1 + t}}\right)}^{y} \]

    if -0.048000000000000001 < y < 6.9000000000000002e134

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.9000000000000002e134 < y

    1. Initial program 88.2%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.048:\\ \;\;\;\;x \cdot {\left(\frac{z}{t + 1}\right)}^{y}\\ \mathbf{elif}\;y \leq 6.9 \cdot 10^{+134}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 73.2% accurate, 2.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -0.0519999999999999976 or 8e17 < y

    1. Initial program 94.0%

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

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

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

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

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

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

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

    if -0.0519999999999999976 < y < 8e17

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-lft-neg-out84.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.052 \lor \neg \left(y \leq 8 \cdot 10^{+17}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 55.5% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.6 \cdot 10^{-33} \lor \neg \left(y \leq 2.9 \cdot 10^{-102}\right):\\
\;\;\;\;x \cdot {z}^{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.60000000000000062e-33 or 2.89999999999999986e-102 < y

    1. Initial program 94.9%

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

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

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

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

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

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

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

    if -8.60000000000000062e-33 < y < 2.89999999999999986e-102

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(b + z\right)} \]
      3. *-commutative91.8%

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

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

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

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

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

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

        \[\leadsto x - \left(a \cdot x\right) \cdot \color{blue}{\left(z + b\right)} \]
    11. Simplified45.2%

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

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

        \[\leadsto x - z \cdot \color{blue}{\left(\frac{a \cdot \left(b \cdot x\right)}{z} + a \cdot x\right)} \]
      2. associate-/l*45.3%

        \[\leadsto x - z \cdot \left(\color{blue}{a \cdot \frac{b \cdot x}{z}} + a \cdot x\right) \]
      3. distribute-lft-out51.2%

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

        \[\leadsto x - z \cdot \left(a \cdot \left(\frac{\color{blue}{x \cdot b}}{z} + x\right)\right) \]
    14. Simplified51.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.6 \cdot 10^{-33} \lor \neg \left(y \leq 2.9 \cdot 10^{-102}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot \left(a \cdot \left(x + \frac{x \cdot b}{z}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 25.7% accurate, 15.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4 \cdot 10^{-21}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\

\mathbf{elif}\;a \leq 8.5 \cdot 10^{-144}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.40000000000000002e-21

    1. Initial program 89.2%

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

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{\left(-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)\right)}} \]
    4. Step-by-step derivation
      1. +-commutative94.5%

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

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-lft-neg-out68.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(a \cdot b\right) \cdot x} \]
      3. distribute-lft-neg-in27.5%

        \[\leadsto \color{blue}{\left(-a \cdot b\right) \cdot x} \]
      4. distribute-rgt-neg-out27.5%

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

        \[\leadsto \color{blue}{x \cdot \left(a \cdot \left(-b\right)\right)} \]
      6. distribute-rgt-neg-out27.5%

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

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

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

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

    if -1.40000000000000002e-21 < a < 8.49999999999999958e-144

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if 8.49999999999999958e-144 < a < 5.5000000000000002e100

    1. Initial program 93.3%

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

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{\left(-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)\right)}} \]
    4. Step-by-step derivation
      1. +-commutative96.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-t \cdot y\right)}\right) \]
      2. distribute-rgt-neg-in31.8%

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

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

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

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

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

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

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

    if 5.5000000000000002e100 < a

    1. Initial program 92.9%

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

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{\left(-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)\right)}} \]
    4. Step-by-step derivation
      1. +-commutative96.5%

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

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-lft-neg-out75.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-1 \cdot a\right) \cdot \left(b \cdot x\right)} \]
      2. neg-mul-126.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.4 \cdot 10^{-21}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{-144}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{+100}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 25.8% accurate, 15.0× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{if}\;a \leq -1.4 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 3.4 \cdot 10^{-140}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.40000000000000002e-21 or 7.49999999999999963e99 < a

    1. Initial program 91.1%

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

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{\left(-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)\right)}} \]
    4. Step-by-step derivation
      1. +-commutative95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(a \cdot b\right) \cdot x} \]
      3. distribute-lft-neg-in27.1%

        \[\leadsto \color{blue}{\left(-a \cdot b\right) \cdot x} \]
      4. distribute-rgt-neg-out27.1%

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

        \[\leadsto \color{blue}{x \cdot \left(a \cdot \left(-b\right)\right)} \]
      6. distribute-rgt-neg-out27.1%

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

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

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

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

    if -1.40000000000000002e-21 < a < 3.40000000000000008e-140

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if 3.40000000000000008e-140 < a < 7.49999999999999963e99

    1. Initial program 93.3%

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

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{\left(-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)\right)}} \]
    4. Step-by-step derivation
      1. +-commutative96.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-t \cdot y\right)}\right) \]
      2. distribute-rgt-neg-in31.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.4 \cdot 10^{-21}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{-140}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{+99}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 23.1% accurate, 16.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 6 \cdot 10^{-224}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 5.99999999999999963e-224

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    13. Step-by-step derivation
      1. associate-*r*20.1%

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

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

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

    if 5.99999999999999963e-224 < x < 2.8999999999999999e121

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.8999999999999999e121 < x

    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. Add Preprocessing
    3. Taylor expanded in z around 0 100.0%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-lft-neg-out61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 6 \cdot 10^{-224}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{elif}\;x \leq 2.9 \cdot 10^{+121}:\\ \;\;\;\;t \cdot \left(\frac{x}{t} - x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(\frac{x}{a} - x \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 23.9% accurate, 16.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.75 \cdot 10^{-218}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 1.75e-218

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    13. Step-by-step derivation
      1. associate-*r*20.7%

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

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

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

    if 1.75e-218 < x < 1.6999999999999999e208

    1. Initial program 93.8%

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

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{\left(-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)\right)}} \]
    4. Step-by-step derivation
      1. +-commutative96.8%

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

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-lft-neg-out62.1%

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

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

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

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

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

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

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

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

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

    if 1.6999999999999999e208 < x

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-lft-neg-out68.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto b \cdot \left(\frac{x}{b} + \color{blue}{\left(-1 \cdot a\right) \cdot x}\right) \]
      3. neg-mul-157.8%

        \[\leadsto b \cdot \left(\frac{x}{b} + \color{blue}{\left(-a\right)} \cdot x\right) \]
      4. cancel-sign-sub-inv57.8%

        \[\leadsto b \cdot \color{blue}{\left(\frac{x}{b} - a \cdot x\right)} \]
      5. *-commutative57.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.75 \cdot 10^{-218}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{+208}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 23.6% accurate, 16.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.9 \cdot 10^{-219}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 2.89999999999999984e-219

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    13. Step-by-step derivation
      1. associate-*r*20.7%

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

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

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

    if 2.89999999999999984e-219 < x < 2.5999999999999999e121

    1. Initial program 91.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-t \cdot y\right)}\right) \]
      2. distribute-rgt-neg-in34.8%

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

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

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

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

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

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

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

    if 2.5999999999999999e121 < x

    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. Add Preprocessing
    3. Taylor expanded in z around 0 100.0%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-lft-neg-out61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.9 \cdot 10^{-219}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{+121}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(\frac{x}{a} - x \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 25.1% accurate, 17.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 7 \cdot 10^{-219}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 7.00000000000000022e-219

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    13. Step-by-step derivation
      1. associate-*r*20.7%

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

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

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

    if 7.00000000000000022e-219 < x

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \left(a \cdot x\right) \cdot \color{blue}{\left(z + b\right)} \]
    11. Simplified34.1%

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

      \[\leadsto x - \color{blue}{z \cdot \left(a \cdot x + \frac{a \cdot \left(b \cdot x\right)}{z}\right)} \]
    13. Step-by-step derivation
      1. +-commutative35.2%

        \[\leadsto x - z \cdot \color{blue}{\left(\frac{a \cdot \left(b \cdot x\right)}{z} + a \cdot x\right)} \]
      2. associate-/l*34.3%

        \[\leadsto x - z \cdot \left(\color{blue}{a \cdot \frac{b \cdot x}{z}} + a \cdot x\right) \]
      3. distribute-lft-out40.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 7 \cdot 10^{-219}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot \left(a \cdot \left(x + \frac{x \cdot b}{z}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 24.2% accurate, 18.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.12 \cdot 10^{-218}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 1.11999999999999996e-218

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    13. Step-by-step derivation
      1. associate-*r*20.7%

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

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

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

    if 1.11999999999999996e-218 < x < 3.4999999999999999e242

    1. Initial program 94.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.4999999999999999e242 < x

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.12 \cdot 10^{-218}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{+242}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x - t \cdot \left(x \cdot y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 31.9% accurate, 18.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.05 \cdot 10^{+112}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \left(-t\right)\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{+146}:\\ \;\;\;\;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 (<= t -1.05e+112)
   (* (* x y) (- t))
   (if (<= t 2.1e+146) (* 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 (t <= -1.05e+112) {
		tmp = (x * y) * -t;
	} else if (t <= 2.1e+146) {
		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 (t <= (-1.05d+112)) then
        tmp = (x * y) * -t
    else if (t <= 2.1d+146) 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 (t <= -1.05e+112) {
		tmp = (x * y) * -t;
	} else if (t <= 2.1e+146) {
		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 t <= -1.05e+112:
		tmp = (x * y) * -t
	elif t <= 2.1e+146:
		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 (t <= -1.05e+112)
		tmp = Float64(Float64(x * y) * Float64(-t));
	elseif (t <= 2.1e+146)
		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 (t <= -1.05e+112)
		tmp = (x * y) * -t;
	elseif (t <= 2.1e+146)
		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[LessEqual[t, -1.05e+112], N[(N[(x * y), $MachinePrecision] * (-t)), $MachinePrecision], If[LessEqual[t, 2.1e+146], 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}\;t \leq -1.05 \cdot 10^{+112}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \left(-t\right)\\

\mathbf{elif}\;t \leq 2.1 \cdot 10^{+146}:\\
\;\;\;\;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 3 regimes
  2. if t < -1.0499999999999999e112

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.0499999999999999e112 < t < 2.1000000000000001e146

    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. Add Preprocessing
    3. Taylor expanded in z around 0 99.4%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-lft-neg-out66.5%

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

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

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

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

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

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

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

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

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

    if 2.1000000000000001e146 < t

    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. Add Preprocessing
    3. Taylor expanded in z around 0 94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.05 \cdot 10^{+112}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \left(-t\right)\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{+146}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 26.3% accurate, 19.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{-23} \lor \neg \left(a \leq 6.55 \cdot 10^{+81}\right):\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.99999999999999987e-23 or 6.54999999999999981e81 < a

    1. Initial program 88.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(a \cdot b\right) \cdot x} \]
      3. distribute-lft-neg-in26.7%

        \[\leadsto \color{blue}{\left(-a \cdot b\right) \cdot x} \]
      4. distribute-rgt-neg-out26.7%

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

        \[\leadsto \color{blue}{x \cdot \left(a \cdot \left(-b\right)\right)} \]
      6. distribute-rgt-neg-out26.7%

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

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

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

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

    if -6.99999999999999987e-23 < a < 6.54999999999999981e81

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7 \cdot 10^{-23} \lor \neg \left(a \leq 6.55 \cdot 10^{+81}\right):\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 24.2% accurate, 22.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1e-218

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    13. Step-by-step derivation
      1. associate-*r*20.7%

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

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

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

    if 1e-218 < x

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot \left(b + z\right)\right)}\right) \]
      2. *-commutative36.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 10^{-218}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 24.0% accurate, 26.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.8 \cdot 10^{-219}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 3.80000000000000025e-219

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    13. Step-by-step derivation
      1. associate-*r*20.7%

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

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

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

    if 3.80000000000000025e-219 < x

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 3.8 \cdot 10^{-219}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 25.6% accurate, 28.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.5 \cdot 10^{+24}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 9.5000000000000001e24

    1. Initial program 95.5%

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

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

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

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

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

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

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

    if 9.5000000000000001e24 < y

    1. Initial program 91.2%

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

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{\left(-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)\right)}} \]
    4. Step-by-step derivation
      1. +-commutative91.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 9.5 \cdot 10^{+24}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 19.5% 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 94.5%

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

      \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
    2. sub-neg96.1%

      \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
    3. log1p-define98.8%

      \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
  3. Simplified98.8%

    \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in a around 0 65.6%

    \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
  6. Taylor expanded in y around 0 19.4%

    \[\leadsto \color{blue}{x} \]
  7. Add Preprocessing

Reproduce

?
herbie shell --seed 2024145 
(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))))))