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

Percentage Accurate: 96.5% → 99.6%
Time: 18.0s
Alternatives: 17
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 17 alternatives:

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

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

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

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

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

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

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

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

    \[\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 simplification99.6%

    \[\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 -6.2 \cdot 10^{+194}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\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 -6.2e+194)
   (* x (exp (* a (- (- z) b))))
   (* 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 <= -6.2e+194) {
		tmp = x * exp((a * (-z - b)));
	} 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 <= (-6.2d+194)) then
        tmp = x * exp((a * (-z - b)))
    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 <= -6.2e+194) {
		tmp = x * Math.exp((a * (-z - b)));
	} 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 <= -6.2e+194:
		tmp = x * math.exp((a * (-z - b)))
	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 <= -6.2e+194)
		tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b))));
	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 <= -6.2e+194)
		tmp = x * exp((a * (-z - b)));
	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, -6.2e+194], N[(x * N[Exp[N[(a * N[((-z) - b), $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 -6.2 \cdot 10^{+194}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\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 < -6.1999999999999999e194

    1. Initial program 76.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 70.3%

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

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

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

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

      \[\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.6%

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

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

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

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

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

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

    if -6.1999999999999999e194 < a

    1. Initial program 97.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. Recombined 2 regimes into one program.
  4. Final simplification96.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.2 \cdot 10^{+194}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\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: 87.2% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -35000000 \lor \neg \left(y \leq 5.4 \cdot 10^{-7}\right):\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\

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


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

    1. Initial program 96.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 a around 0 90.7%

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

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

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

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

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

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

    if -3.5e7 < y < 5.40000000000000018e-7

    1. Initial program 92.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 0 80.8%

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 88.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. +-commutative88.4%

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

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

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

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

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

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

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

Alternative 4: 75.0% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot {z}^{y}\\ \mathbf{if}\;y \leq -2.1 \cdot 10^{+146}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1 \cdot 10^{+31}:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{elif}\;y \leq -10000000 \lor \neg \left(y \leq 8 \cdot 10^{+24}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (pow z y))))
   (if (<= y -2.1e+146)
     t_1
     (if (<= y -1e+31)
       (* x (exp (* t (- y))))
       (if (or (<= y -10000000.0) (not (<= y 8e+24)))
         t_1
         (* x (exp (* a (- (- z) b)))))))))
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 <= -2.1e+146) {
		tmp = t_1;
	} else if (y <= -1e+31) {
		tmp = x * exp((t * -y));
	} else if ((y <= -10000000.0) || !(y <= 8e+24)) {
		tmp = t_1;
	} else {
		tmp = x * exp((a * (-z - b)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (z ** y)
    if (y <= (-2.1d+146)) then
        tmp = t_1
    else if (y <= (-1d+31)) then
        tmp = x * exp((t * -y))
    else if ((y <= (-10000000.0d0)) .or. (.not. (y <= 8d+24))) then
        tmp = t_1
    else
        tmp = x * exp((a * (-z - b)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * Math.pow(z, y);
	double tmp;
	if (y <= -2.1e+146) {
		tmp = t_1;
	} else if (y <= -1e+31) {
		tmp = x * Math.exp((t * -y));
	} else if ((y <= -10000000.0) || !(y <= 8e+24)) {
		tmp = t_1;
	} else {
		tmp = x * Math.exp((a * (-z - b)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.pow(z, y)
	tmp = 0
	if y <= -2.1e+146:
		tmp = t_1
	elif y <= -1e+31:
		tmp = x * math.exp((t * -y))
	elif (y <= -10000000.0) or not (y <= 8e+24):
		tmp = t_1
	else:
		tmp = x * math.exp((a * (-z - b)))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * (z ^ y))
	tmp = 0.0
	if (y <= -2.1e+146)
		tmp = t_1;
	elseif (y <= -1e+31)
		tmp = Float64(x * exp(Float64(t * Float64(-y))));
	elseif ((y <= -10000000.0) || !(y <= 8e+24))
		tmp = t_1;
	else
		tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * (z ^ y);
	tmp = 0.0;
	if (y <= -2.1e+146)
		tmp = t_1;
	elseif (y <= -1e+31)
		tmp = x * exp((t * -y));
	elseif ((y <= -10000000.0) || ~((y <= 8e+24)))
		tmp = t_1;
	else
		tmp = x * exp((a * (-z - b)));
	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, -2.1e+146], t$95$1, If[LessEqual[y, -1e+31], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -10000000.0], N[Not[LessEqual[y, 8e+24]], $MachinePrecision]], t$95$1, N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq -10000000 \lor \neg \left(y \leq 8 \cdot 10^{+24}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.1000000000000001e146 or -9.9999999999999996e30 < y < -1e7 or 7.9999999999999999e24 < y

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

    if -2.1000000000000001e146 < y < -9.9999999999999996e30

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

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

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

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

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

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

    if -1e7 < y < 7.9999999999999999e24

    1. Initial program 92.0%

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 86.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. +-commutative86.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{+146}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq -1 \cdot 10^{+31}:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{elif}\;y \leq -10000000 \lor \neg \left(y \leq 8 \cdot 10^{+24}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 72.2% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot {z}^{y}\\ \mathbf{if}\;y \leq -2.75 \cdot 10^{+146}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{+31}:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{elif}\;y \leq -6400000 \lor \neg \left(y \leq 1.2 \cdot 10^{-5}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (pow z y))))
   (if (<= y -2.75e+146)
     t_1
     (if (<= y -1.8e+31)
       (* x (exp (* t (- y))))
       (if (or (<= y -6400000.0) (not (<= y 1.2e-5)))
         t_1
         (* x (exp (* a (- b)))))))))
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 <= -2.75e+146) {
		tmp = t_1;
	} else if (y <= -1.8e+31) {
		tmp = x * exp((t * -y));
	} else if ((y <= -6400000.0) || !(y <= 1.2e-5)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = x * (z ** y)
    if (y <= (-2.75d+146)) then
        tmp = t_1
    else if (y <= (-1.8d+31)) then
        tmp = x * exp((t * -y))
    else if ((y <= (-6400000.0d0)) .or. (.not. (y <= 1.2d-5))) then
        tmp = t_1
    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 t_1 = x * Math.pow(z, y);
	double tmp;
	if (y <= -2.75e+146) {
		tmp = t_1;
	} else if (y <= -1.8e+31) {
		tmp = x * Math.exp((t * -y));
	} else if ((y <= -6400000.0) || !(y <= 1.2e-5)) {
		tmp = t_1;
	} else {
		tmp = x * Math.exp((a * -b));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.pow(z, y)
	tmp = 0
	if y <= -2.75e+146:
		tmp = t_1
	elif y <= -1.8e+31:
		tmp = x * math.exp((t * -y))
	elif (y <= -6400000.0) or not (y <= 1.2e-5):
		tmp = t_1
	else:
		tmp = x * math.exp((a * -b))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * (z ^ y))
	tmp = 0.0
	if (y <= -2.75e+146)
		tmp = t_1;
	elseif (y <= -1.8e+31)
		tmp = Float64(x * exp(Float64(t * Float64(-y))));
	elseif ((y <= -6400000.0) || !(y <= 1.2e-5))
		tmp = t_1;
	else
		tmp = Float64(x * exp(Float64(a * Float64(-b))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * (z ^ y);
	tmp = 0.0;
	if (y <= -2.75e+146)
		tmp = t_1;
	elseif (y <= -1.8e+31)
		tmp = x * exp((t * -y));
	elseif ((y <= -6400000.0) || ~((y <= 1.2e-5)))
		tmp = t_1;
	else
		tmp = x * exp((a * -b));
	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, -2.75e+146], t$95$1, If[LessEqual[y, -1.8e+31], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -6400000.0], N[Not[LessEqual[y, 1.2e-5]], $MachinePrecision]], t$95$1, N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq -6400000 \lor \neg \left(y \leq 1.2 \cdot 10^{-5}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.7500000000000002e146 or -1.79999999999999998e31 < y < -6.4e6 or 1.2e-5 < y

    1. Initial program 97.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 a around 0 93.0%

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

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

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

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

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

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

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

    if -2.7500000000000002e146 < y < -1.79999999999999998e31

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

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

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

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

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

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

    if -6.4e6 < y < 1.2e-5

    1. Initial program 92.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 80.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.75 \cdot 10^{+146}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{+31}:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{elif}\;y \leq -6400000 \lor \neg \left(y \leq 1.2 \cdot 10^{-5}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 73.8% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -6500000 \lor \neg \left(y \leq 1.2 \cdot 10^{-5}\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 -6500000.0) (not (<= y 1.2e-5)))
   (* 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 <= -6500000.0) || !(y <= 1.2e-5)) {
		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 <= (-6500000.0d0)) .or. (.not. (y <= 1.2d-5))) 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 <= -6500000.0) || !(y <= 1.2e-5)) {
		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 <= -6500000.0) or not (y <= 1.2e-5):
		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 <= -6500000.0) || !(y <= 1.2e-5))
		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 <= -6500000.0) || ~((y <= 1.2e-5)))
		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, -6500000.0], N[Not[LessEqual[y, 1.2e-5]], $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 -6500000 \lor \neg \left(y \leq 1.2 \cdot 10^{-5}\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 < -6.5e6 or 1.2e-5 < y

    1. Initial program 96.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 a around 0 90.7%

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

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

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

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

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

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

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

    if -6.5e6 < y < 1.2e-5

    1. Initial program 92.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 80.1%

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

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

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

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

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

Alternative 7: 55.8% accurate, 2.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9200 or 1.15e-20 < y

    1. Initial program 97.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 a around 0 88.7%

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

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

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

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

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

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

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

    if -9200 < y < 1.15e-20

    1. Initial program 92.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 80.5%

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

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

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

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

      \[\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. +-commutative88.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 30.9% accurate, 11.6× speedup?

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

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

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

\mathbf{elif}\;y \leq 1.8 \cdot 10^{-267}:\\
\;\;\;\;b \cdot \frac{x}{b}\\

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

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


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

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

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

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

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

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

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

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

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

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

    if -2.0499999999999999e213 < y < -1.39999999999999995e-229

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.39999999999999995e-229 < y < 1.8000000000000001e-267

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto b \cdot \color{blue}{\frac{x}{b}} \]

    if 1.8000000000000001e-267 < y < 350

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

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

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

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

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

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

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

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

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

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

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

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

    if 350 < y

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{+213}:\\ \;\;\;\;x - t \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-229}:\\ \;\;\;\;a \cdot \left(\frac{x}{a} - x \cdot b\right)\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-267}:\\ \;\;\;\;b \cdot \frac{x}{b}\\ \mathbf{elif}\;y \leq 350:\\ \;\;\;\;x - b \cdot \left(x \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a \cdot \left(-x\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 34.1% accurate, 13.1× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -5.40000000000000018e214

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

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

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

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

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

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

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

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

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

    if -5.40000000000000018e214 < y < -2.30000000000000004e-42

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.30000000000000004e-42 < y < 1.35000000000000002e48

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

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

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

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

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

      \[\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. +-commutative85.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.35000000000000002e48 < y

    1. Initial program 100.0%

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

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

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

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

      \[\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*12.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.4 \cdot 10^{+214}:\\ \;\;\;\;x - t \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \leq -2.3 \cdot 10^{-42}:\\ \;\;\;\;b \cdot \left(a \cdot \left(\frac{x}{a \cdot b} - x\right)\right)\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+48}:\\ \;\;\;\;x - \left(z + b\right) \cdot \left(x \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a \cdot \left(-x\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 33.5% accurate, 14.3× speedup?

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

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

\mathbf{elif}\;y \leq -1.4 \cdot 10^{+23}:\\
\;\;\;\;b \cdot \frac{x}{b}\\

\mathbf{elif}\;y \leq 350:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.99999999999999976e166

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999999976e166 < y < -1.4e23

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto b \cdot \color{blue}{\frac{x}{b}} \]

    if -1.4e23 < y < 350

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

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

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

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

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

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

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

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

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

    if 350 < y

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 32.7% accurate, 14.3× speedup?

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

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

\mathbf{elif}\;y \leq -2.7 \cdot 10^{+21}:\\
\;\;\;\;b \cdot \frac{x}{b}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.85000000000000013e165

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.85000000000000013e165 < y < -2.7e21

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto b \cdot \color{blue}{\frac{x}{b}} \]

    if -2.7e21 < y < 350

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

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

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

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

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

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

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

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

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

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

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

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

    if 350 < y

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.85 \cdot 10^{+165}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq -2.7 \cdot 10^{+21}:\\ \;\;\;\;b \cdot \frac{x}{b}\\ \mathbf{elif}\;y \leq 350:\\ \;\;\;\;x - b \cdot \left(x \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a \cdot \left(-x\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 30.3% accurate, 16.6× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

    if -3.0000000000000001e213 < y < 1.35000000000000002e48

    1. Initial program 93.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 67.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.35000000000000002e48 < y

    1. Initial program 100.0%

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

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

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

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

      \[\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*12.6%

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

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

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

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

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

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

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

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

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

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

Alternative 13: 32.5% accurate, 18.5× speedup?

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

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

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

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


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

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.90000000000000021e22 < y < 46000

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

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

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

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

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

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

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

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

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

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

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

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

    if 46000 < y

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 28.3% accurate, 19.6× speedup?

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

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

\mathbf{elif}\;y \leq 1.35 \cdot 10^{+48}:\\
\;\;\;\;b \cdot \frac{x}{b}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.80000000000000019e168 < y < 1.35000000000000002e48

    1. Initial program 92.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 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto b \cdot \color{blue}{\frac{x}{b}} \]

    if 1.35000000000000002e48 < y

    1. Initial program 100.0%

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

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

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

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

      \[\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*12.6%

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

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

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

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

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

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

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

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

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

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

Alternative 15: 27.0% accurate, 28.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.8 \cdot 10^{+51}:\\
\;\;\;\;b \cdot \frac{x}{b}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto b \cdot \color{blue}{\frac{x}{b}} \]

    if 1.80000000000000005e51 < y

    1. Initial program 100.0%

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

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

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

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

      \[\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*12.6%

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

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

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

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

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

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

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

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

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

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

Alternative 16: 24.9% accurate, 63.0× speedup?

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

\\
b \cdot \frac{x}{b}
\end{array}
Derivation
  1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto b \cdot \color{blue}{\frac{x}{b}} \]
  11. Final simplification25.9%

    \[\leadsto b \cdot \frac{x}{b} \]
  12. Add Preprocessing

Alternative 17: 19.2% accurate, 315.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 94.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 b around inf 55.3%

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

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

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

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

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

    \[\leadsto x \]
  8. Add Preprocessing

Reproduce

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