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

Percentage Accurate: 96.6% → 99.5%
Time: 15.7s
Alternatives: 18
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 18 alternatives:

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

Initial Program: 96.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 0.8× speedup?

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

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

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

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

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

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

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

Alternative 2: 96.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -7.8 \cdot 10^{+158}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + 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 -7.8e+158)
   (* 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 <= -7.8e+158) {
		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 <= (-7.8d+158)) 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 <= -7.8e+158) {
		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 <= -7.8e+158:
		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 <= -7.8e+158)
		tmp = Float64(x * exp(Float64(Float64(-a) * 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 <= -7.8e+158)
		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, -7.8e+158], 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 -7.8 \cdot 10^{+158}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + 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 < -7.8e158

    1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

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

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

    if -7.8e158 < a

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

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

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -7.8 \cdot 10^{+70}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \mathbf{elif}\;a \leq 3.1 \cdot 10^{+90}:\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -7.8e+70)
   (* x (exp (* (- a) (+ z b))))
   (if (<= a 3.1e+90)
     (* x (exp (* y (- (log z) t))))
     (* x (exp (* a (- (log1p (- z)) b)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -7.8e+70) {
		tmp = x * exp((-a * (z + b)));
	} else if (a <= 3.1e+90) {
		tmp = x * exp((y * (log(z) - t)));
	} else {
		tmp = x * exp((a * (log1p(-z) - b)));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -7.8e+70) {
		tmp = x * Math.exp((-a * (z + b)));
	} else if (a <= 3.1e+90) {
		tmp = x * Math.exp((y * (Math.log(z) - t)));
	} else {
		tmp = x * Math.exp((a * (Math.log1p(-z) - b)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -7.8e+70:
		tmp = x * math.exp((-a * (z + b)))
	elif a <= 3.1e+90:
		tmp = x * math.exp((y * (math.log(z) - t)))
	else:
		tmp = x * math.exp((a * (math.log1p(-z) - b)))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -7.8e+70)
		tmp = Float64(x * exp(Float64(Float64(-a) * Float64(z + b))));
	elseif (a <= 3.1e+90)
		tmp = Float64(x * exp(Float64(y * Float64(log(z) - t))));
	else
		tmp = Float64(x * exp(Float64(a * Float64(log1p(Float64(-z)) - b))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -7.8e+70], N[(x * N[Exp[N[((-a) * N[(z + b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.1e+90], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq 3.1 \cdot 10^{+90}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\

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


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

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

    if -7.79999999999999949e70 < a < 3.09999999999999988e90

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

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

    if 3.09999999999999988e90 < a

    1. Initial program 93.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.8 \cdot 10^{+70}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \mathbf{elif}\;a \leq 3.1 \cdot 10^{+90}:\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 83.9% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{+70} \lor \neg \left(a \leq 6.1 \cdot 10^{+94}\right):\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.49999999999999986e70 or 6.10000000000000035e94 < a

    1. Initial program 89.6%

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

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

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

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

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

      \[\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. associate-*r*83.5%

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

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

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

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

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

    if -5.49999999999999986e70 < a < 6.10000000000000035e94

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

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

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

Alternative 5: 76.6% accurate, 2.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.9199999999999999 or 2.6999999999999998e-12 < y

    1. Initial program 94.5%

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

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

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

    if -1.9199999999999999 < y < 2.6999999999999998e-12

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 73.9% accurate, 2.7× speedup?

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

    1. Initial program 94.5%

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

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

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

    if -1.1000000000000001 < y < 2.6999999999999998e-12

    1. Initial program 97.7%

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

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

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

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

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

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

Alternative 7: 56.7% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{-18} \lor \neg \left(y \leq 3.8 \cdot 10^{-13}\right):\\
\;\;\;\;x \cdot {z}^{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.0000000000000003e-18 or 3.8e-13 < y

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

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

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

    if -4.0000000000000003e-18 < y < 3.8e-13

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 34.0% accurate, 7.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+203}:\\ \;\;\;\;x - x \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-8}:\\ \;\;\;\;a \cdot \left(b \cdot \left(\frac{x}{a \cdot b} - x\right)\right)\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{-76}:\\ \;\;\;\;z \cdot \left(\frac{x}{z} - x \cdot a\right)\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{-217}:\\ \;\;\;\;a \cdot \frac{x}{a}\\ \mathbf{elif}\;y \leq 0.0006:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{+188}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+238}:\\ \;\;\;\;y \cdot \left(\frac{x}{y} - x \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -9e+203)
   (- x (* x (* y t)))
   (if (<= y -2.2e-8)
     (* a (* b (- (/ x (* a b)) x)))
     (if (<= y -5.5e-76)
       (* z (- (/ x z) (* x a)))
       (if (<= y -1.2e-217)
         (* a (/ x a))
         (if (<= y 0.0006)
           (* x (- 1.0 (* a b)))
           (if (<= y 1.02e+188)
             (* x (* a (- b)))
             (if (<= y 2.1e+238)
               (* y (- (/ x y) (* x t)))
               (* x (* z (- a)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -9e+203) {
		tmp = x - (x * (y * t));
	} else if (y <= -2.2e-8) {
		tmp = a * (b * ((x / (a * b)) - x));
	} else if (y <= -5.5e-76) {
		tmp = z * ((x / z) - (x * a));
	} else if (y <= -1.2e-217) {
		tmp = a * (x / a);
	} else if (y <= 0.0006) {
		tmp = x * (1.0 - (a * b));
	} else if (y <= 1.02e+188) {
		tmp = x * (a * -b);
	} else if (y <= 2.1e+238) {
		tmp = y * ((x / y) - (x * t));
	} else {
		tmp = x * (z * -a);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (y <= (-9d+203)) then
        tmp = x - (x * (y * t))
    else if (y <= (-2.2d-8)) then
        tmp = a * (b * ((x / (a * b)) - x))
    else if (y <= (-5.5d-76)) then
        tmp = z * ((x / z) - (x * a))
    else if (y <= (-1.2d-217)) then
        tmp = a * (x / a)
    else if (y <= 0.0006d0) then
        tmp = x * (1.0d0 - (a * b))
    else if (y <= 1.02d+188) then
        tmp = x * (a * -b)
    else if (y <= 2.1d+238) then
        tmp = y * ((x / y) - (x * t))
    else
        tmp = x * (z * -a)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -9e+203) {
		tmp = x - (x * (y * t));
	} else if (y <= -2.2e-8) {
		tmp = a * (b * ((x / (a * b)) - x));
	} else if (y <= -5.5e-76) {
		tmp = z * ((x / z) - (x * a));
	} else if (y <= -1.2e-217) {
		tmp = a * (x / a);
	} else if (y <= 0.0006) {
		tmp = x * (1.0 - (a * b));
	} else if (y <= 1.02e+188) {
		tmp = x * (a * -b);
	} else if (y <= 2.1e+238) {
		tmp = y * ((x / y) - (x * t));
	} else {
		tmp = x * (z * -a);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -9e+203:
		tmp = x - (x * (y * t))
	elif y <= -2.2e-8:
		tmp = a * (b * ((x / (a * b)) - x))
	elif y <= -5.5e-76:
		tmp = z * ((x / z) - (x * a))
	elif y <= -1.2e-217:
		tmp = a * (x / a)
	elif y <= 0.0006:
		tmp = x * (1.0 - (a * b))
	elif y <= 1.02e+188:
		tmp = x * (a * -b)
	elif y <= 2.1e+238:
		tmp = y * ((x / y) - (x * t))
	else:
		tmp = x * (z * -a)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -9e+203)
		tmp = Float64(x - Float64(x * Float64(y * t)));
	elseif (y <= -2.2e-8)
		tmp = Float64(a * Float64(b * Float64(Float64(x / Float64(a * b)) - x)));
	elseif (y <= -5.5e-76)
		tmp = Float64(z * Float64(Float64(x / z) - Float64(x * a)));
	elseif (y <= -1.2e-217)
		tmp = Float64(a * Float64(x / a));
	elseif (y <= 0.0006)
		tmp = Float64(x * Float64(1.0 - Float64(a * b)));
	elseif (y <= 1.02e+188)
		tmp = Float64(x * Float64(a * Float64(-b)));
	elseif (y <= 2.1e+238)
		tmp = Float64(y * Float64(Float64(x / y) - Float64(x * t)));
	else
		tmp = Float64(x * Float64(z * Float64(-a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -9e+203)
		tmp = x - (x * (y * t));
	elseif (y <= -2.2e-8)
		tmp = a * (b * ((x / (a * b)) - x));
	elseif (y <= -5.5e-76)
		tmp = z * ((x / z) - (x * a));
	elseif (y <= -1.2e-217)
		tmp = a * (x / a);
	elseif (y <= 0.0006)
		tmp = x * (1.0 - (a * b));
	elseif (y <= 1.02e+188)
		tmp = x * (a * -b);
	elseif (y <= 2.1e+238)
		tmp = y * ((x / y) - (x * t));
	else
		tmp = x * (z * -a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -9e+203], N[(x - N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.2e-8], N[(a * N[(b * N[(N[(x / N[(a * b), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.5e-76], N[(z * N[(N[(x / z), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.2e-217], N[(a * N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.0006], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e+188], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e+238], N[(y * N[(N[(x / y), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq -5.5 \cdot 10^{-76}:\\
\;\;\;\;z \cdot \left(\frac{x}{z} - x \cdot a\right)\\

\mathbf{elif}\;y \leq -1.2 \cdot 10^{-217}:\\
\;\;\;\;a \cdot \frac{x}{a}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 8 regimes
  2. if y < -9.0000000000000006e203

    1. Initial program 95.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 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \sqrt{\color{blue}{t \cdot t}} \cdot \left(y \cdot x\right) \]
      4. sqrt-unprod0.0%

        \[\leadsto x + \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot \left(y \cdot x\right) \]
      5. add-sqr-sqrt9.2%

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

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

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

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

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

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

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

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

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

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

    if -9.0000000000000006e203 < y < -2.1999999999999998e-8

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

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

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

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

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

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

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

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

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

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

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

    if -2.1999999999999998e-8 < y < -5.50000000000000014e-76

    1. Initial program 99.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 74.1%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(\frac{x}{z} - a \cdot x\right)} \]
    11. Step-by-step derivation
      1. *-commutative43.7%

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

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

    if -5.50000000000000014e-76 < y < -1.1999999999999999e-217

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

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

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

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

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

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

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

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

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

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

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

    if -1.1999999999999999e-217 < y < 5.99999999999999947e-4

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

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

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

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

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

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

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

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

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

    if 5.99999999999999947e-4 < y < 1.02e188

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.02e188 < y < 2.10000000000000007e238

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.10000000000000007e238 < 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 y around 0 43.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+203}:\\ \;\;\;\;x - x \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-8}:\\ \;\;\;\;a \cdot \left(b \cdot \left(\frac{x}{a \cdot b} - x\right)\right)\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{-76}:\\ \;\;\;\;z \cdot \left(\frac{x}{z} - x \cdot a\right)\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{-217}:\\ \;\;\;\;a \cdot \frac{x}{a}\\ \mathbf{elif}\;y \leq 0.0006:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{+188}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+238}:\\ \;\;\;\;y \cdot \left(\frac{x}{y} - x \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 33.9% accurate, 10.8× speedup?

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.25000000000000008e-84 < y < 3.3e-4

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

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

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

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

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

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

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

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

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

    if 3.3e-4 < y < 2.70000000000000007e181

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.70000000000000007e181 < y < 7.19999999999999942e238

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.19999999999999942e238 < 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 y around 0 43.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 34.3% accurate, 18.5× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.19999999999999985e-83 < y < 8.9999999999999999e-10

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

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

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

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

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

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

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

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

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

    if 8.9999999999999999e-10 < y

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 32.9% accurate, 18.5× speedup?

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

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

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

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


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

    1. Initial program 95.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 57.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot \left(y \cdot x\right) \]
      5. add-sqr-sqrt15.2%

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

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

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

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

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

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

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

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

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

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

    if -1.0000000000000001e-208 < y < 7.2e-9

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

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

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

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

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

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

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

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

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

    if 7.2e-9 < y

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 33.1% accurate, 18.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+78}:\\
\;\;\;\;a \cdot \frac{x}{a}\\

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

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


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

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

    if -1.59999999999999997e78 < y < 2.70000000000000005e-11

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

    if 2.70000000000000005e-11 < y

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 28.5% accurate, 28.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.6 \cdot 10^{-25}:\\
\;\;\;\;a \cdot \frac{x}{a}\\

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


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

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

    if 9.60000000000000037e-25 < y

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 27.9% accurate, 28.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.8 \cdot 10^{-25}:\\
\;\;\;\;a \cdot \frac{x}{a}\\

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


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

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

    if 7.8e-25 < y

    1. Initial program 95.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 33.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 27.7% accurate, 28.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.4 \cdot 10^{-25}:\\
\;\;\;\;a \cdot \frac{x}{a}\\

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


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

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

    if 5.40000000000000032e-25 < y

    1. Initial program 95.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 33.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 26.1% accurate, 31.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.15 \cdot 10^{+66}:\\
\;\;\;\;a \cdot \frac{x}{a}\\

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


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

    1. Initial program 95.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 65.8%

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

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

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

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

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

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

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

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

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

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

    if 1.15e66 < y

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\left(-x\right) \cdot \left(a \cdot b\right)\right)}}^{1} \]
      4. add-sqr-sqrt15.0%

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

        \[\leadsto {\left(\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \left(a \cdot b\right)\right)}^{1} \]
      6. sqr-neg25.9%

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

        \[\leadsto {\left(\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \left(a \cdot b\right)\right)}^{1} \]
      8. add-sqr-sqrt20.6%

        \[\leadsto {\left(\color{blue}{x} \cdot \left(a \cdot b\right)\right)}^{1} \]
    13. Applied egg-rr20.6%

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(x \cdot b\right)} \]
    15. Simplified20.6%

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

Alternative 17: 23.3% accurate, 31.5× speedup?

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

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

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


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

    1. Initial program 96.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 68.4%

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

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

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

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

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

    if 1.7e-5 < y

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \left(a \cdot b\right)\right)}^{1} \]
      6. sqr-neg24.5%

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

        \[\leadsto {\left(\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \left(a \cdot b\right)\right)}^{1} \]
      8. add-sqr-sqrt20.5%

        \[\leadsto {\left(\color{blue}{x} \cdot \left(a \cdot b\right)\right)}^{1} \]
    13. Applied egg-rr20.5%

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(x \cdot b\right)} \]
    15. Simplified19.1%

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

Alternative 18: 19.3% 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 96.1%

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  7. Add Preprocessing

Reproduce

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