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

Percentage Accurate: 96.9% → 99.7%
Time: 18.4s
Alternatives: 19
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 19 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.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

Alternative 2: 96.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -9.4 \cdot 10^{+198}:\\ \;\;\;\;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 -9.4e+198)
   (* 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 <= -9.4e+198) {
		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 <= (-9.4d+198)) 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 <= -9.4e+198) {
		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 <= -9.4e+198:
		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 <= -9.4e+198)
		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 <= -9.4e+198)
		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, -9.4e+198], 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 -9.4 \cdot 10^{+198}:\\
\;\;\;\;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 < -9.4000000000000004e198

    1. Initial program 61.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 51.1%

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

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

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

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

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

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

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

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

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

    if -9.4000000000000004e198 < a

    1. Initial program 97.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9.4 \cdot 10^{+198}:\\ \;\;\;\;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: 87.7% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-22} \lor \neg \left(y \leq 3.8 \cdot 10^{-9}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\

\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 < -2.9999999999999999e-22 or 3.80000000000000011e-9 < y

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

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

    if -2.9999999999999999e-22 < y < 3.80000000000000011e-9

    1. Initial program 90.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 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-define89.9%

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

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

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

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

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

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

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

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

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

Alternative 4: 70.8% accurate, 2.5× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot e^{y \cdot \left(-t\right)}\\
t_2 := x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{if}\;b \leq -1.8 \cdot 10^{+37}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;b \leq -2.3 \cdot 10^{-216}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 7.2 \cdot 10^{-230}:\\
\;\;\;\;x \cdot {z}^{y}\\

\mathbf{elif}\;b \leq 4.4 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.79999999999999999e37 or 4.3999999999999997e35 < b

    1. Initial program 99.0%

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

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

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

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

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

    if -1.79999999999999999e37 < b < -2.29999999999999997e-216 or 7.1999999999999997e-230 < b < 4.3999999999999997e35

    1. Initial program 94.1%

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

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

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

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

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

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

    if -2.29999999999999997e-216 < b < 7.1999999999999997e-230

    1. Initial program 84.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.8 \cdot 10^{+37}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{elif}\;b \leq -2.3 \cdot 10^{-216}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{elif}\;b \leq 7.2 \cdot 10^{-230}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;b \leq 4.4 \cdot 10^{+35}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 76.7% accurate, 2.7× speedup?

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

    1. Initial program 98.4%

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

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

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

    if -2.5 < y < 4.8e6

    1. Initial program 91.1%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.5 \lor \neg \left(y \leq 4800000\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: 71.8% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -90 \lor \neg \left(t \leq 5.8 \cdot 10^{+56}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -90 or 5.80000000000000014e56 < t

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

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

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

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

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

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

    if -90 < t < 5.80000000000000014e56

    1. Initial program 93.3%

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

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

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

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

Alternative 7: 53.4% accurate, 2.9× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.79999999999999982 < t

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

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

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

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

Alternative 8: 33.6% accurate, 8.3× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \left(x \cdot \left(\frac{1 - z \cdot a}{b} - a\right)\right)\\
t_2 := x \cdot \left(1 - z \cdot \left(a + a \cdot \frac{b}{z}\right)\right)\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{+182}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\

\mathbf{elif}\;y \leq 2.55 \cdot 10^{-278}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 3.8 \cdot 10^{-209}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 3.1 \cdot 10^{-120}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.5:\\
\;\;\;\;t\_2\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.7999999999999997e182 < y < 2.55000000000000005e-278 or 3.7999999999999999e-209 < y < 3.10000000000000019e-120

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto b \cdot \left(x \cdot \frac{1 - a \cdot z}{b} + \color{blue}{x \cdot \left(-a\right)}\right) \]
      6. distribute-lft-out45.0%

        \[\leadsto b \cdot \color{blue}{\left(x \cdot \left(\frac{1 - a \cdot z}{b} + \left(-a\right)\right)\right)} \]
      7. unsub-neg45.0%

        \[\leadsto b \cdot \left(x \cdot \color{blue}{\left(\frac{1 - a \cdot z}{b} - a\right)}\right) \]
      8. *-commutative45.0%

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

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

    if 2.55000000000000005e-278 < y < 3.7999999999999999e-209 or 3.10000000000000019e-120 < y < 1.5

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5 < y

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{+182}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{elif}\;y \leq 2.55 \cdot 10^{-278}:\\ \;\;\;\;b \cdot \left(x \cdot \left(\frac{1 - z \cdot a}{b} - a\right)\right)\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-209}:\\ \;\;\;\;x \cdot \left(1 - z \cdot \left(a + a \cdot \frac{b}{z}\right)\right)\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{-120}:\\ \;\;\;\;b \cdot \left(x \cdot \left(\frac{1 - z \cdot a}{b} - a\right)\right)\\ \mathbf{elif}\;y \leq 1.5:\\ \;\;\;\;x \cdot \left(1 - z \cdot \left(a + a \cdot \frac{b}{z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 34.2% accurate, 9.5× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \left(x \cdot \left(\frac{1 - z \cdot a}{b} - a\right)\right)\\
\mathbf{if}\;y \leq -1.75 \cdot 10^{+180}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\

\mathbf{elif}\;y \leq -7 \cdot 10^{-83}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 0.9:\\
\;\;\;\;t\_1\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7499999999999999e180 < y < -7.00000000000000061e-83 or 7.20000000000000032e-232 < y < 0.900000000000000022

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto b \cdot \color{blue}{\left(x \cdot \left(\frac{1 - a \cdot z}{b} + \left(-a\right)\right)\right)} \]
      7. unsub-neg40.6%

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

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

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

    if -7.00000000000000061e-83 < y < 7.20000000000000032e-232

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.900000000000000022 < y

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{+180}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{elif}\;y \leq -7 \cdot 10^{-83}:\\ \;\;\;\;b \cdot \left(x \cdot \left(\frac{1 - z \cdot a}{b} - a\right)\right)\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-232}:\\ \;\;\;\;x - x \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;y \leq 0.9:\\ \;\;\;\;b \cdot \left(x \cdot \left(\frac{1 - z \cdot a}{b} - a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 33.5% accurate, 10.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.15 \cdot 10^{+179}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-40}:\\ \;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-187}:\\ \;\;\;\;x - x \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;y \leq 0.9:\\ \;\;\;\;t \cdot \left(\frac{x}{t} - x \cdot y\right)\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+173}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -1.15e+179)
   (* x (* y (- t)))
   (if (<= y -8.5e-40)
     (* b (- (/ x b) (* x a)))
     (if (<= y 2.2e-187)
       (- x (* x (* a b)))
       (if (<= y 0.9)
         (* t (- (/ x t) (* x y)))
         (if (<= y 4.5e+173) (* x (* a (- b))) (* (- a) (* x b))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -1.15e+179) {
		tmp = x * (y * -t);
	} else if (y <= -8.5e-40) {
		tmp = b * ((x / b) - (x * a));
	} else if (y <= 2.2e-187) {
		tmp = x - (x * (a * b));
	} else if (y <= 0.9) {
		tmp = t * ((x / t) - (x * y));
	} else if (y <= 4.5e+173) {
		tmp = x * (a * -b);
	} else {
		tmp = -a * (x * b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (y <= (-1.15d+179)) then
        tmp = x * (y * -t)
    else if (y <= (-8.5d-40)) then
        tmp = b * ((x / b) - (x * a))
    else if (y <= 2.2d-187) then
        tmp = x - (x * (a * b))
    else if (y <= 0.9d0) then
        tmp = t * ((x / t) - (x * y))
    else if (y <= 4.5d+173) then
        tmp = x * (a * -b)
    else
        tmp = -a * (x * b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -1.15e+179) {
		tmp = x * (y * -t);
	} else if (y <= -8.5e-40) {
		tmp = b * ((x / b) - (x * a));
	} else if (y <= 2.2e-187) {
		tmp = x - (x * (a * b));
	} else if (y <= 0.9) {
		tmp = t * ((x / t) - (x * y));
	} else if (y <= 4.5e+173) {
		tmp = x * (a * -b);
	} else {
		tmp = -a * (x * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -1.15e+179:
		tmp = x * (y * -t)
	elif y <= -8.5e-40:
		tmp = b * ((x / b) - (x * a))
	elif y <= 2.2e-187:
		tmp = x - (x * (a * b))
	elif y <= 0.9:
		tmp = t * ((x / t) - (x * y))
	elif y <= 4.5e+173:
		tmp = x * (a * -b)
	else:
		tmp = -a * (x * b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -1.15e+179)
		tmp = Float64(x * Float64(y * Float64(-t)));
	elseif (y <= -8.5e-40)
		tmp = Float64(b * Float64(Float64(x / b) - Float64(x * a)));
	elseif (y <= 2.2e-187)
		tmp = Float64(x - Float64(x * Float64(a * b)));
	elseif (y <= 0.9)
		tmp = Float64(t * Float64(Float64(x / t) - Float64(x * y)));
	elseif (y <= 4.5e+173)
		tmp = Float64(x * Float64(a * Float64(-b)));
	else
		tmp = Float64(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+179)
		tmp = x * (y * -t);
	elseif (y <= -8.5e-40)
		tmp = b * ((x / b) - (x * a));
	elseif (y <= 2.2e-187)
		tmp = x - (x * (a * b));
	elseif (y <= 0.9)
		tmp = t * ((x / t) - (x * y));
	elseif (y <= 4.5e+173)
		tmp = x * (a * -b);
	else
		tmp = -a * (x * b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.15e+179], N[(x * N[(y * (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -8.5e-40], N[(b * N[(N[(x / b), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e-187], N[(x - N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.9], N[(t * N[(N[(x / t), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+173], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], N[((-a) * N[(x * b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;y \leq 0.9:\\
\;\;\;\;t \cdot \left(\frac{x}{t} - x \cdot y\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -1.14999999999999997e179

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.14999999999999997e179 < y < -8.4999999999999998e-40

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.4999999999999998e-40 < y < 2.20000000000000008e-187

    1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.20000000000000008e-187 < y < 0.900000000000000022

    1. Initial program 88.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 60.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.900000000000000022 < y < 4.5000000000000002e173

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.5000000000000002e173 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.15 \cdot 10^{+179}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-40}:\\ \;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-187}:\\ \;\;\;\;x - x \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;y \leq 0.9:\\ \;\;\;\;t \cdot \left(\frac{x}{t} - x \cdot y\right)\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+173}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 33.7% accurate, 10.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{+181}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-42}:\\ \;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-186}:\\ \;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\ \mathbf{elif}\;y \leq 1.4:\\ \;\;\;\;t \cdot \left(\frac{x}{t} - x \cdot y\right)\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+172}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -1.35e+181)
   (* x (* y (- t)))
   (if (<= y -1.7e-42)
     (* b (- (/ x b) (* x a)))
     (if (<= y 1.5e-186)
       (* x (- 1.0 (* a (+ z b))))
       (if (<= y 1.4)
         (* t (- (/ x t) (* x y)))
         (if (<= y 2e+172) (* x (* a (- b))) (* (- a) (* x b))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -1.35e+181) {
		tmp = x * (y * -t);
	} else if (y <= -1.7e-42) {
		tmp = b * ((x / b) - (x * a));
	} else if (y <= 1.5e-186) {
		tmp = x * (1.0 - (a * (z + b)));
	} else if (y <= 1.4) {
		tmp = t * ((x / t) - (x * y));
	} else if (y <= 2e+172) {
		tmp = x * (a * -b);
	} else {
		tmp = -a * (x * b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (y <= (-1.35d+181)) then
        tmp = x * (y * -t)
    else if (y <= (-1.7d-42)) then
        tmp = b * ((x / b) - (x * a))
    else if (y <= 1.5d-186) then
        tmp = x * (1.0d0 - (a * (z + b)))
    else if (y <= 1.4d0) then
        tmp = t * ((x / t) - (x * y))
    else if (y <= 2d+172) then
        tmp = x * (a * -b)
    else
        tmp = -a * (x * b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -1.35e+181) {
		tmp = x * (y * -t);
	} else if (y <= -1.7e-42) {
		tmp = b * ((x / b) - (x * a));
	} else if (y <= 1.5e-186) {
		tmp = x * (1.0 - (a * (z + b)));
	} else if (y <= 1.4) {
		tmp = t * ((x / t) - (x * y));
	} else if (y <= 2e+172) {
		tmp = x * (a * -b);
	} else {
		tmp = -a * (x * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -1.35e+181:
		tmp = x * (y * -t)
	elif y <= -1.7e-42:
		tmp = b * ((x / b) - (x * a))
	elif y <= 1.5e-186:
		tmp = x * (1.0 - (a * (z + b)))
	elif y <= 1.4:
		tmp = t * ((x / t) - (x * y))
	elif y <= 2e+172:
		tmp = x * (a * -b)
	else:
		tmp = -a * (x * b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -1.35e+181)
		tmp = Float64(x * Float64(y * Float64(-t)));
	elseif (y <= -1.7e-42)
		tmp = Float64(b * Float64(Float64(x / b) - Float64(x * a)));
	elseif (y <= 1.5e-186)
		tmp = Float64(x * Float64(1.0 - Float64(a * Float64(z + b))));
	elseif (y <= 1.4)
		tmp = Float64(t * Float64(Float64(x / t) - Float64(x * y)));
	elseif (y <= 2e+172)
		tmp = Float64(x * Float64(a * Float64(-b)));
	else
		tmp = Float64(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.35e+181)
		tmp = x * (y * -t);
	elseif (y <= -1.7e-42)
		tmp = b * ((x / b) - (x * a));
	elseif (y <= 1.5e-186)
		tmp = x * (1.0 - (a * (z + b)));
	elseif (y <= 1.4)
		tmp = t * ((x / t) - (x * y));
	elseif (y <= 2e+172)
		tmp = x * (a * -b);
	else
		tmp = -a * (x * b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.35e+181], N[(x * N[(y * (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.7e-42], N[(b * N[(N[(x / b), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e-186], N[(x * N[(1.0 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4], N[(t * N[(N[(x / t), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+172], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], N[((-a) * N[(x * b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;y \leq 1.4:\\
\;\;\;\;t \cdot \left(\frac{x}{t} - x \cdot y\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -1.35000000000000004e181

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35000000000000004e181 < y < -1.70000000000000011e-42

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.70000000000000011e-42 < y < 1.5000000000000001e-186

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5000000000000001e-186 < y < 1.3999999999999999

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3999999999999999 < y < 2.0000000000000002e172

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000002e172 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{+181}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-42}:\\ \;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-186}:\\ \;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\ \mathbf{elif}\;y \leq 1.4:\\ \;\;\;\;t \cdot \left(\frac{x}{t} - x \cdot y\right)\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+172}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 33.0% accurate, 14.3× speedup?

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.4000000000000003e180 < y < -2.4e16

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.4e16 < y < 1.3999999999999999

    1. Initial program 91.1%

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

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

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

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

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

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

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

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

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

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

    if 1.3999999999999999 < y

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 34.7% accurate, 14.3× speedup?

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.4999999999999998e180 < y < -2.8000000000000002e-41

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8000000000000002e-41 < y < 3.0500000000000001e-19

    1. Initial program 91.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 78.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.0500000000000001e-19 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{+180}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-41}:\\ \;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\ \mathbf{elif}\;y \leq 3.05 \cdot 10^{-19}:\\ \;\;\;\;x - x \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 29.0% accurate, 15.0× speedup?

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

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

\mathbf{elif}\;y \leq -5.1 \cdot 10^{+15} \lor \neg \left(y \leq 0.9\right):\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8e182 < y < -5.1e15 or 0.900000000000000022 < y

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.1e15 < y < 0.900000000000000022

    1. Initial program 91.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+182}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{elif}\;y \leq -5.1 \cdot 10^{+15} \lor \neg \left(y \leq 0.9\right):\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 29.0% accurate, 15.0× speedup?

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

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

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

\mathbf{elif}\;y \leq 3.05 \cdot 10^{-19}:\\
\;\;\;\;x\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.60000000000000024e180 < y < -9.2e15

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.2e15 < y < 3.0500000000000001e-19

    1. Initial program 90.8%

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

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

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

    if 3.0500000000000001e-19 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.6 \cdot 10^{+180}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{elif}\;y \leq -9.2 \cdot 10^{+15}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq 3.05 \cdot 10^{-19}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 33.7% accurate, 18.5× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.89999999999999984e178 < y < 1.46000000000000008e-19

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.46000000000000008e-19 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 28.2% accurate, 19.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+15} \lor \neg \left(y \leq 0.9\right):\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.5e15 or 0.900000000000000022 < y

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.5e15 < y < 0.900000000000000022

    1. Initial program 91.1%

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

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

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

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

Alternative 18: 20.9% accurate, 31.5× speedup?

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

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

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


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

    1. Initial program 95.1%

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

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

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

    if 8.4000000000000001e83 < a

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 19.6% accurate, 315.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification20.2%

    \[\leadsto x \]
  6. Add Preprocessing

Reproduce

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