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

Percentage Accurate: 96.6% → 99.5%
Time: 20.1s
Alternatives: 14
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 14 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.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 95.4%

    \[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-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. Final simplification100.0%

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

Alternative 2: 96.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+237}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\

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


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

    1. Initial program 60.5%

      \[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 y around 0 67.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3e237 < a

    1. Initial program 97.5%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification97.3%

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

Alternative 3: 83.6% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4 \cdot 10^{-22} \lor \neg \left(a \leq 2.2 \cdot 10^{+33}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.0000000000000002e-22 or 2.19999999999999994e33 < a

    1. Initial program 90.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 y around 0 74.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.0000000000000002e-22 < a < 2.19999999999999994e33

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

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

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

Alternative 4: 73.2% accurate, 2.6× speedup?

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

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

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

\mathbf{elif}\;y \leq 6 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -0.045999999999999999 or 0.23499999999999999 < y < 6.00000000000000025e71

    1. Initial program 98.6%

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

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

      \[\leadsto \color{blue}{x \cdot {z}^{y}} \]
    5. Step-by-step derivation
      1. *-commutative78.3%

        \[\leadsto \color{blue}{{z}^{y} \cdot x} \]
    6. Simplified78.3%

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

    if -0.045999999999999999 < y < 0.23499999999999999

    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 b around inf 82.0%

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

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

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

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

    if 6.00000000000000025e71 < 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 t around inf 74.0%

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

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

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

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

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

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

Alternative 5: 75.7% accurate, 2.6× speedup?

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

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

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

\mathbf{elif}\;y \leq 2.6 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.6e8 or 0.23499999999999999 < y < 2.59999999999999991e71

    1. Initial program 98.6%

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

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

      \[\leadsto \color{blue}{x \cdot {z}^{y}} \]
    5. Step-by-step derivation
      1. *-commutative78.3%

        \[\leadsto \color{blue}{{z}^{y} \cdot x} \]
    6. Simplified78.3%

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

    if -3.6e8 < y < 0.23499999999999999

    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 y around 0 82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.59999999999999991e71 < 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 t around inf 74.0%

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

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

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

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

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

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

Alternative 6: 74.1% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -7300 \lor \neg \left(y \leq 0.14\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 -7300.0) (not (<= y 0.14)))
   (* 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 <= -7300.0) || !(y <= 0.14)) {
		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 <= (-7300.0d0)) .or. (.not. (y <= 0.14d0))) 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 <= -7300.0) || !(y <= 0.14)) {
		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 <= -7300.0) or not (y <= 0.14):
		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 <= -7300.0) || !(y <= 0.14))
		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 <= -7300.0) || ~((y <= 0.14)))
		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, -7300.0], N[Not[LessEqual[y, 0.14]], $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 -7300 \lor \neg \left(y \leq 0.14\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 < -7300 or 0.14000000000000001 < y

    1. Initial program 95.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 y around inf 87.8%

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

      \[\leadsto \color{blue}{x \cdot {z}^{y}} \]
    5. Step-by-step derivation
      1. *-commutative71.0%

        \[\leadsto \color{blue}{{z}^{y} \cdot x} \]
    6. Simplified71.0%

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

    if -7300 < y < 0.14000000000000001

    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 b around inf 82.0%

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

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

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

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

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

Alternative 7: 56.1% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{-7} \lor \neg \left(y \leq 0.09\right):\\
\;\;\;\;x \cdot {z}^{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.80000000000000049e-7 or 0.089999999999999997 < y

    1. Initial program 95.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 y around inf 87.8%

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

      \[\leadsto \color{blue}{x \cdot {z}^{y}} \]
    5. Step-by-step derivation
      1. *-commutative71.0%

        \[\leadsto \color{blue}{{z}^{y} \cdot x} \]
    6. Simplified71.0%

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

    if -7.80000000000000049e-7 < y < 0.089999999999999997

    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 b around inf 82.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 27.1% accurate, 12.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.15 \cdot 10^{-21}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{-110}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{-149}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -2.15e-21)
   (* x (* a (- b)))
   (if (<= y -1.75e-110)
     x
     (if (<= y -1.2e-149)
       (* b (* x (- a)))
       (if (<= y 4.2e-27) x (* a (* x (- b))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -2.15e-21) {
		tmp = x * (a * -b);
	} else if (y <= -1.75e-110) {
		tmp = x;
	} else if (y <= -1.2e-149) {
		tmp = b * (x * -a);
	} else if (y <= 4.2e-27) {
		tmp = x;
	} else {
		tmp = a * (x * -b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (y <= (-2.15d-21)) then
        tmp = x * (a * -b)
    else if (y <= (-1.75d-110)) then
        tmp = x
    else if (y <= (-1.2d-149)) then
        tmp = b * (x * -a)
    else if (y <= 4.2d-27) then
        tmp = x
    else
        tmp = a * (x * -b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -2.15e-21) {
		tmp = x * (a * -b);
	} else if (y <= -1.75e-110) {
		tmp = x;
	} else if (y <= -1.2e-149) {
		tmp = b * (x * -a);
	} else if (y <= 4.2e-27) {
		tmp = x;
	} else {
		tmp = a * (x * -b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -2.15e-21:
		tmp = x * (a * -b)
	elif y <= -1.75e-110:
		tmp = x
	elif y <= -1.2e-149:
		tmp = b * (x * -a)
	elif y <= 4.2e-27:
		tmp = x
	else:
		tmp = a * (x * -b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -2.15e-21)
		tmp = Float64(x * Float64(a * Float64(-b)));
	elseif (y <= -1.75e-110)
		tmp = x;
	elseif (y <= -1.2e-149)
		tmp = Float64(b * Float64(x * Float64(-a)));
	elseif (y <= 4.2e-27)
		tmp = x;
	else
		tmp = Float64(a * Float64(x * Float64(-b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -2.15e-21)
		tmp = x * (a * -b);
	elseif (y <= -1.75e-110)
		tmp = x;
	elseif (y <= -1.2e-149)
		tmp = b * (x * -a);
	elseif (y <= 4.2e-27)
		tmp = x;
	else
		tmp = a * (x * -b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.15e-21], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.75e-110], x, If[LessEqual[y, -1.2e-149], N[(b * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e-27], x, N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.75 \cdot 10^{-110}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;y \leq 4.2 \cdot 10^{-27}:\\
\;\;\;\;x\\

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


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

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1499999999999999e-21 < y < -1.74999999999999987e-110 or -1.2000000000000001e-149 < y < 4.20000000000000031e-27

    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 y around inf 56.0%

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

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

    if -1.74999999999999987e-110 < y < -1.2000000000000001e-149

    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. Add Preprocessing
    3. Taylor expanded in b around inf 86.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.20000000000000031e-27 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.15 \cdot 10^{-21}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{-110}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{-149}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 27.1% accurate, 12.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{-23}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-108}:\\ \;\;\;\;x \cdot \left(1 + a \cdot b\right)\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-146}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -3.4e-23)
   (* x (* a (- b)))
   (if (<= y -1.4e-108)
     (* x (+ 1.0 (* a b)))
     (if (<= y -3.8e-146)
       (* b (* x (- a)))
       (if (<= y 4e-27) x (* a (* x (- b))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -3.4e-23) {
		tmp = x * (a * -b);
	} else if (y <= -1.4e-108) {
		tmp = x * (1.0 + (a * b));
	} else if (y <= -3.8e-146) {
		tmp = b * (x * -a);
	} else if (y <= 4e-27) {
		tmp = x;
	} else {
		tmp = a * (x * -b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (y <= (-3.4d-23)) then
        tmp = x * (a * -b)
    else if (y <= (-1.4d-108)) then
        tmp = x * (1.0d0 + (a * b))
    else if (y <= (-3.8d-146)) then
        tmp = b * (x * -a)
    else if (y <= 4d-27) then
        tmp = x
    else
        tmp = a * (x * -b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -3.4e-23) {
		tmp = x * (a * -b);
	} else if (y <= -1.4e-108) {
		tmp = x * (1.0 + (a * b));
	} else if (y <= -3.8e-146) {
		tmp = b * (x * -a);
	} else if (y <= 4e-27) {
		tmp = x;
	} else {
		tmp = a * (x * -b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -3.4e-23:
		tmp = x * (a * -b)
	elif y <= -1.4e-108:
		tmp = x * (1.0 + (a * b))
	elif y <= -3.8e-146:
		tmp = b * (x * -a)
	elif y <= 4e-27:
		tmp = x
	else:
		tmp = a * (x * -b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -3.4e-23)
		tmp = Float64(x * Float64(a * Float64(-b)));
	elseif (y <= -1.4e-108)
		tmp = Float64(x * Float64(1.0 + Float64(a * b)));
	elseif (y <= -3.8e-146)
		tmp = Float64(b * Float64(x * Float64(-a)));
	elseif (y <= 4e-27)
		tmp = x;
	else
		tmp = Float64(a * Float64(x * Float64(-b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -3.4e-23)
		tmp = x * (a * -b);
	elseif (y <= -1.4e-108)
		tmp = x * (1.0 + (a * b));
	elseif (y <= -3.8e-146)
		tmp = b * (x * -a);
	elseif (y <= 4e-27)
		tmp = x;
	else
		tmp = a * (x * -b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.4e-23], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.4e-108], N[(x * N[(1.0 + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.8e-146], N[(b * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e-27], x, N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;y \leq 4 \cdot 10^{-27}:\\
\;\;\;\;x\\

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


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

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.4000000000000001e-23 < y < -1.4e-108

    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. Add Preprocessing
    3. Taylor expanded in b around inf 69.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{a \cdot \left(-x \cdot b\right)} \]
      6. add-sqr-sqrt12.2%

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

        \[\leadsto x + \color{blue}{\sqrt{a \cdot a}} \cdot \left(-x \cdot b\right) \]
      8. sqr-neg42.9%

        \[\leadsto x + \sqrt{\color{blue}{\left(-a\right) \cdot \left(-a\right)}} \cdot \left(-x \cdot b\right) \]
      9. sqrt-unprod26.6%

        \[\leadsto x + \color{blue}{\left(\sqrt{-a} \cdot \sqrt{-a}\right)} \cdot \left(-x \cdot b\right) \]
      10. add-sqr-sqrt43.2%

        \[\leadsto x + \color{blue}{\left(-a\right)} \cdot \left(-x \cdot b\right) \]
      11. cancel-sign-sub-inv43.2%

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

        \[\leadsto x - \color{blue}{\left(-a \cdot \left(x \cdot b\right)\right)} \]
      13. distribute-lft-neg-in43.2%

        \[\leadsto x - \color{blue}{\left(-a\right) \cdot \left(x \cdot b\right)} \]
      14. cancel-sign-sub43.2%

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

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

        \[\leadsto x + \color{blue}{\left(a \cdot b\right) \cdot x} \]
      17. distribute-rgt1-in43.1%

        \[\leadsto \color{blue}{\left(a \cdot b + 1\right) \cdot x} \]
    10. Applied egg-rr43.1%

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

    if -1.4e-108 < y < -3.79999999999999994e-146

    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. Add Preprocessing
    3. Taylor expanded in b around inf 88.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.79999999999999994e-146 < y < 4.0000000000000002e-27

    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. Add Preprocessing
    3. Taylor expanded in y around inf 53.0%

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

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

    if 4.0000000000000002e-27 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{-23}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-108}:\\ \;\;\;\;x \cdot \left(1 + a \cdot b\right)\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-146}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 27.0% accurate, 12.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{-21}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-108}:\\ \;\;\;\;x + a \cdot \left(x \cdot b\right)\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{-146}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -2.1e-21)
   (* x (* a (- b)))
   (if (<= y -1.7e-108)
     (+ x (* a (* x b)))
     (if (<= y -5.2e-146)
       (* b (* x (- a)))
       (if (<= y 3.8e-27) x (* a (* x (- b))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -2.1e-21) {
		tmp = x * (a * -b);
	} else if (y <= -1.7e-108) {
		tmp = x + (a * (x * b));
	} else if (y <= -5.2e-146) {
		tmp = b * (x * -a);
	} else if (y <= 3.8e-27) {
		tmp = x;
	} else {
		tmp = a * (x * -b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (y <= (-2.1d-21)) then
        tmp = x * (a * -b)
    else if (y <= (-1.7d-108)) then
        tmp = x + (a * (x * b))
    else if (y <= (-5.2d-146)) then
        tmp = b * (x * -a)
    else if (y <= 3.8d-27) then
        tmp = x
    else
        tmp = a * (x * -b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -2.1e-21) {
		tmp = x * (a * -b);
	} else if (y <= -1.7e-108) {
		tmp = x + (a * (x * b));
	} else if (y <= -5.2e-146) {
		tmp = b * (x * -a);
	} else if (y <= 3.8e-27) {
		tmp = x;
	} else {
		tmp = a * (x * -b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -2.1e-21:
		tmp = x * (a * -b)
	elif y <= -1.7e-108:
		tmp = x + (a * (x * b))
	elif y <= -5.2e-146:
		tmp = b * (x * -a)
	elif y <= 3.8e-27:
		tmp = x
	else:
		tmp = a * (x * -b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -2.1e-21)
		tmp = Float64(x * Float64(a * Float64(-b)));
	elseif (y <= -1.7e-108)
		tmp = Float64(x + Float64(a * Float64(x * b)));
	elseif (y <= -5.2e-146)
		tmp = Float64(b * Float64(x * Float64(-a)));
	elseif (y <= 3.8e-27)
		tmp = x;
	else
		tmp = Float64(a * Float64(x * Float64(-b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -2.1e-21)
		tmp = x * (a * -b);
	elseif (y <= -1.7e-108)
		tmp = x + (a * (x * b));
	elseif (y <= -5.2e-146)
		tmp = b * (x * -a);
	elseif (y <= 3.8e-27)
		tmp = x;
	else
		tmp = a * (x * -b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.1e-21], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.7e-108], N[(x + N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.2e-146], N[(b * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e-27], x, N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;y \leq 3.8 \cdot 10^{-27}:\\
\;\;\;\;x\\

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


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

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.10000000000000013e-21 < y < -1.70000000000000001e-108

    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. Add Preprocessing
    3. Taylor expanded in b around inf 69.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{a \cdot \left(-x \cdot b\right)} \]
      6. add-sqr-sqrt12.2%

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

        \[\leadsto x + \color{blue}{\sqrt{a \cdot a}} \cdot \left(-x \cdot b\right) \]
      8. sqr-neg42.9%

        \[\leadsto x + \sqrt{\color{blue}{\left(-a\right) \cdot \left(-a\right)}} \cdot \left(-x \cdot b\right) \]
      9. sqrt-unprod26.6%

        \[\leadsto x + \color{blue}{\left(\sqrt{-a} \cdot \sqrt{-a}\right)} \cdot \left(-x \cdot b\right) \]
      10. add-sqr-sqrt43.2%

        \[\leadsto x + \color{blue}{\left(-a\right)} \cdot \left(-x \cdot b\right) \]
      11. cancel-sign-sub-inv43.2%

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

        \[\leadsto x - \color{blue}{\left(-a \cdot \left(x \cdot b\right)\right)} \]
      13. distribute-lft-neg-in43.2%

        \[\leadsto x - \color{blue}{\left(-a\right) \cdot \left(x \cdot b\right)} \]
      14. cancel-sign-sub43.2%

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

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

        \[\leadsto a \cdot \color{blue}{\left(b \cdot x\right)} + x \]
    10. Applied egg-rr43.2%

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

    if -1.70000000000000001e-108 < y < -5.19999999999999974e-146

    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. Add Preprocessing
    3. Taylor expanded in b around inf 88.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.19999999999999974e-146 < y < 3.8e-27

    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. Add Preprocessing
    3. Taylor expanded in y around inf 53.0%

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

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

    if 3.8e-27 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{-21}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-108}:\\ \;\;\;\;x + a \cdot \left(x \cdot b\right)\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{-146}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 27.7% accurate, 19.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{-23} \lor \neg \left(y \leq 4.4 \cdot 10^{-27}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.05000000000000015e-23 or 4.39999999999999974e-27 < y

    1. Initial program 95.4%

      \[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 b around inf 36.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.05000000000000015e-23 < y < 4.39999999999999974e-27

    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 y around inf 53.9%

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

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

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

Alternative 12: 31.4% accurate, 26.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 0.8:\\ \;\;\;\;x - x \cdot \left(a \cdot b\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 (<= y 0.8) (- x (* x (* a b))) (* a (* x (- b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= 0.8) {
		tmp = x - (x * (a * b));
	} else {
		tmp = a * (x * -b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (y <= 0.8d0) then
        tmp = x - (x * (a * b))
    else
        tmp = a * (x * -b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= 0.8) {
		tmp = x - (x * (a * b));
	} else {
		tmp = a * (x * -b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= 0.8:
		tmp = x - (x * (a * b))
	else:
		tmp = a * (x * -b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= 0.8)
		tmp = Float64(x - Float64(x * Float64(a * b)));
	else
		tmp = Float64(a * Float64(x * Float64(-b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= 0.8)
		tmp = x - (x * (a * b));
	else
		tmp = a * (x * -b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 0.8], N[(x - N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.8:\\
\;\;\;\;x - x \cdot \left(a \cdot b\right)\\

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


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

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

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

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

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

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

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

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

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

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

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

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

    if 0.80000000000000004 < y

    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 b around inf 33.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 0.8:\\ \;\;\;\;x - x \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 23.1% accurate, 31.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.12 \cdot 10^{-13}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.12e-13) x (* a (* x b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= 1.12e-13) {
		tmp = x;
	} else {
		tmp = a * (x * b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (y <= 1.12d-13) then
        tmp = x
    else
        tmp = a * (x * b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= 1.12e-13) {
		tmp = x;
	} else {
		tmp = a * (x * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= 1.12e-13:
		tmp = x
	else:
		tmp = a * (x * b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= 1.12e-13)
		tmp = x;
	else
		tmp = Float64(a * Float64(x * b));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= 1.12e-13)
		tmp = x;
	else
		tmp = a * (x * b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.12e-13], x, N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

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

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

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

    if 1.12e-13 < y

    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 b around inf 35.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \sqrt{\color{blue}{\left(-a\right) \cdot \left(-a\right)}} \cdot \left(-x \cdot b\right) \]
      9. sqrt-unprod4.4%

        \[\leadsto x + \color{blue}{\left(\sqrt{-a} \cdot \sqrt{-a}\right)} \cdot \left(-x \cdot b\right) \]
      10. add-sqr-sqrt7.2%

        \[\leadsto x + \color{blue}{\left(-a\right)} \cdot \left(-x \cdot b\right) \]
      11. cancel-sign-sub-inv7.2%

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

        \[\leadsto x - \color{blue}{\left(-a \cdot \left(x \cdot b\right)\right)} \]
      13. distribute-lft-neg-in7.2%

        \[\leadsto x - \color{blue}{\left(-a\right) \cdot \left(x \cdot b\right)} \]
      14. cancel-sign-sub7.2%

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

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

        \[\leadsto x + \color{blue}{\left(a \cdot b\right) \cdot x} \]
      17. distribute-rgt1-in6.0%

        \[\leadsto \color{blue}{\left(a \cdot b + 1\right) \cdot x} \]
    10. Applied egg-rr6.0%

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

      \[\leadsto \color{blue}{a \cdot \left(b \cdot x\right)} \]
    12. Step-by-step derivation
      1. *-commutative24.7%

        \[\leadsto a \cdot \color{blue}{\left(x \cdot b\right)} \]
    13. Simplified24.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.12 \cdot 10^{-13}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 19.4% 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 95.4%

    \[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 y around inf 69.4%

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification21.7%

    \[\leadsto x \]
  6. Add Preprocessing

Reproduce

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