
(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:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (x y z t a b) :precision binary64 (* x (exp (- (* y (- (log z) t)) (* a (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) - (a * (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 * (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 * (z + b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) - (a * (z + b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) - Float64(a * Float64(z + b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) - (a * (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[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot \left(z + b\right)}
\end{array}
Initial program 97.9%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -5.3e-21)
(* x (pow (/ z (exp t)) y))
(if (<= y 4e-72)
(* x (exp (* a (- (- b) z))))
(* x (exp (* y (- (log z) t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5.3e-21) {
tmp = x * pow((z / exp(t)), y);
} else if (y <= 4e-72) {
tmp = x * exp((a * (-b - z)));
} else {
tmp = x * exp((y * (log(z) - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-5.3d-21)) then
tmp = x * ((z / exp(t)) ** y)
else if (y <= 4d-72) then
tmp = x * exp((a * (-b - z)))
else
tmp = x * exp((y * (log(z) - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5.3e-21) {
tmp = x * Math.pow((z / Math.exp(t)), y);
} else if (y <= 4e-72) {
tmp = x * Math.exp((a * (-b - z)));
} else {
tmp = x * Math.exp((y * (Math.log(z) - t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -5.3e-21: tmp = x * math.pow((z / math.exp(t)), y) elif y <= 4e-72: tmp = x * math.exp((a * (-b - z))) else: tmp = x * math.exp((y * (math.log(z) - t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -5.3e-21) tmp = Float64(x * (Float64(z / exp(t)) ^ y)); elseif (y <= 4e-72) tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); else tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -5.3e-21) tmp = x * ((z / exp(t)) ^ y); elseif (y <= 4e-72) tmp = x * exp((a * (-b - z))); else tmp = x * exp((y * (log(z) - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -5.3e-21], N[(x * N[Power[N[(z / N[Exp[t], $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e-72], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.3 \cdot 10^{-21}:\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-72}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\end{array}
\end{array}
if y < -5.2999999999999999e-21Initial program 100.0%
Taylor expanded in a around 0 87.7%
*-commutative87.7%
exp-prod87.7%
exp-diff87.7%
rem-exp-log87.7%
Simplified87.7%
if -5.2999999999999999e-21 < y < 3.9999999999999999e-72Initial program 96.1%
Taylor expanded in y around 0 80.8%
Taylor expanded in z around 0 84.6%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified84.6%
if 3.9999999999999999e-72 < y Initial program 98.8%
Taylor expanded in a around 0 91.3%
Final simplification87.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.5e-18) (not (<= y 3.9e-72))) (* x (pow (/ z (exp t)) y)) (* x (exp (* a (- (- b) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.5e-18) || !(y <= 3.9e-72)) {
tmp = x * pow((z / exp(t)), y);
} else {
tmp = x * exp((a * (-b - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-6.5d-18)) .or. (.not. (y <= 3.9d-72))) then
tmp = x * ((z / exp(t)) ** y)
else
tmp = x * exp((a * (-b - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.5e-18) || !(y <= 3.9e-72)) {
tmp = x * Math.pow((z / Math.exp(t)), y);
} else {
tmp = x * Math.exp((a * (-b - z)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.5e-18) or not (y <= 3.9e-72): tmp = x * math.pow((z / math.exp(t)), y) else: tmp = x * math.exp((a * (-b - z))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.5e-18) || !(y <= 3.9e-72)) tmp = Float64(x * (Float64(z / exp(t)) ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.5e-18) || ~((y <= 3.9e-72))) tmp = x * ((z / exp(t)) ^ y); else tmp = x * exp((a * (-b - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.5e-18], N[Not[LessEqual[y, 3.9e-72]], $MachinePrecision]], N[(x * N[Power[N[(z / N[Exp[t], $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{-18} \lor \neg \left(y \leq 3.9 \cdot 10^{-72}\right):\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\end{array}
\end{array}
if y < -6.50000000000000008e-18 or 3.9e-72 < y Initial program 99.3%
Taylor expanded in a around 0 89.7%
*-commutative89.7%
exp-prod89.7%
exp-diff89.7%
rem-exp-log89.7%
Simplified89.7%
if -6.50000000000000008e-18 < y < 3.9e-72Initial program 96.1%
Taylor expanded in y around 0 80.8%
Taylor expanded in z around 0 84.6%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified84.6%
Final simplification87.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* a (- (- b) z))))) (t_2 (* x (exp (* y (- t))))))
(if (<= t -3.25e+15)
t_2
(if (<= t -4e-50)
t_1
(if (<= t -1.25e-123) (* x (pow z y)) (if (<= t 3.8e+37) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((a * (-b - z)));
double t_2 = x * exp((y * -t));
double tmp;
if (t <= -3.25e+15) {
tmp = t_2;
} else if (t <= -4e-50) {
tmp = t_1;
} else if (t <= -1.25e-123) {
tmp = x * pow(z, y);
} else if (t <= 3.8e+37) {
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((a * (-b - z)))
t_2 = x * exp((y * -t))
if (t <= (-3.25d+15)) then
tmp = t_2
else if (t <= (-4d-50)) then
tmp = t_1
else if (t <= (-1.25d-123)) then
tmp = x * (z ** y)
else if (t <= 3.8d+37) 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((a * (-b - z)));
double t_2 = x * Math.exp((y * -t));
double tmp;
if (t <= -3.25e+15) {
tmp = t_2;
} else if (t <= -4e-50) {
tmp = t_1;
} else if (t <= -1.25e-123) {
tmp = x * Math.pow(z, y);
} else if (t <= 3.8e+37) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((a * (-b - z))) t_2 = x * math.exp((y * -t)) tmp = 0 if t <= -3.25e+15: tmp = t_2 elif t <= -4e-50: tmp = t_1 elif t <= -1.25e-123: tmp = x * math.pow(z, y) elif t <= 3.8e+37: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))) t_2 = Float64(x * exp(Float64(y * Float64(-t)))) tmp = 0.0 if (t <= -3.25e+15) tmp = t_2; elseif (t <= -4e-50) tmp = t_1; elseif (t <= -1.25e-123) tmp = Float64(x * (z ^ y)); elseif (t <= 3.8e+37) 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((a * (-b - z))); t_2 = x * exp((y * -t)); tmp = 0.0; if (t <= -3.25e+15) tmp = t_2; elseif (t <= -4e-50) tmp = t_1; elseif (t <= -1.25e-123) tmp = x * (z ^ y); elseif (t <= 3.8e+37) 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[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.25e+15], t$95$2, If[LessEqual[t, -4e-50], t$95$1, If[LessEqual[t, -1.25e-123], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e+37], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
t_2 := x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{if}\;t \leq -3.25 \cdot 10^{+15}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -4 \cdot 10^{-50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.25 \cdot 10^{-123}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -3.25e15 or 3.7999999999999999e37 < t Initial program 99.1%
Taylor expanded in a around 0 86.8%
Taylor expanded in t around inf 86.8%
mul-1-neg86.8%
distribute-lft-neg-out86.8%
*-commutative86.8%
Simplified86.8%
if -3.25e15 < t < -4.00000000000000003e-50 or -1.25000000000000007e-123 < t < 3.7999999999999999e37Initial program 97.1%
Taylor expanded in y around 0 70.9%
Taylor expanded in z around 0 76.3%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified76.3%
if -4.00000000000000003e-50 < t < -1.25000000000000007e-123Initial program 94.2%
Taylor expanded in a around 0 89.1%
*-commutative89.1%
exp-prod89.1%
exp-diff89.1%
rem-exp-log89.1%
Simplified89.1%
Taylor expanded in t around 0 89.1%
Final simplification82.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.7e-38) (not (<= b 1.25e+51))) (* x (exp (* a (- b)))) (* x (exp (* y (- t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.7e-38) || !(b <= 1.25e+51)) {
tmp = x * exp((a * -b));
} else {
tmp = x * exp((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 ((b <= (-2.7d-38)) .or. (.not. (b <= 1.25d+51))) then
tmp = x * exp((a * -b))
else
tmp = x * exp((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 ((b <= -2.7e-38) || !(b <= 1.25e+51)) {
tmp = x * Math.exp((a * -b));
} else {
tmp = x * Math.exp((y * -t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -2.7e-38) or not (b <= 1.25e+51): tmp = x * math.exp((a * -b)) else: tmp = x * math.exp((y * -t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.7e-38) || !(b <= 1.25e+51)) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = Float64(x * exp(Float64(y * Float64(-t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -2.7e-38) || ~((b <= 1.25e+51))) tmp = x * exp((a * -b)); else tmp = x * exp((y * -t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.7e-38], N[Not[LessEqual[b, 1.25e+51]], $MachinePrecision]], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.7 \cdot 10^{-38} \lor \neg \left(b \leq 1.25 \cdot 10^{+51}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\end{array}
\end{array}
if b < -2.70000000000000005e-38 or 1.25e51 < b Initial program 100.0%
Taylor expanded in y around 0 77.2%
Taylor expanded in z around 0 77.2%
mul-1-neg77.2%
distribute-rgt-neg-out77.2%
Simplified77.2%
if -2.70000000000000005e-38 < b < 1.25e51Initial program 95.5%
Taylor expanded in a around 0 89.9%
Taylor expanded in t around inf 74.4%
mul-1-neg74.4%
distribute-lft-neg-out74.4%
*-commutative74.4%
Simplified74.4%
Final simplification75.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.05e+49) (not (<= y 5.8e+64))) (* x (pow z y)) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.05e+49) || !(y <= 5.8e+64)) {
tmp = x * pow(z, y);
} else {
tmp = x * exp((a * -b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.05d+49)) .or. (.not. (y <= 5.8d+64))) then
tmp = x * (z ** y)
else
tmp = x * exp((a * -b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.05e+49) || !(y <= 5.8e+64)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.05e+49) or not (y <= 5.8e+64): tmp = x * math.pow(z, y) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.05e+49) || !(y <= 5.8e+64)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.05e+49) || ~((y <= 5.8e+64))) tmp = x * (z ^ y); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.05e+49], N[Not[LessEqual[y, 5.8e+64]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+49} \lor \neg \left(y \leq 5.8 \cdot 10^{+64}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -1.05000000000000005e49 or 5.79999999999999986e64 < y Initial program 100.0%
Taylor expanded in a around 0 92.8%
*-commutative92.8%
exp-prod92.8%
exp-diff92.8%
rem-exp-log92.8%
Simplified92.8%
Taylor expanded in t around 0 70.2%
if -1.05000000000000005e49 < y < 5.79999999999999986e64Initial program 96.3%
Taylor expanded in y around 0 76.6%
Taylor expanded in z around 0 75.9%
mul-1-neg75.9%
distribute-rgt-neg-out75.9%
Simplified75.9%
Final simplification73.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.15e+181) (* a (* x (- z))) (if (<= t -850.0) (* x (- 1.0 (* y t))) (* x (pow z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.15e+181) {
tmp = a * (x * -z);
} else if (t <= -850.0) {
tmp = x * (1.0 - (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 <= (-1.15d+181)) then
tmp = a * (x * -z)
else if (t <= (-850.0d0)) then
tmp = x * (1.0d0 - (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 <= -1.15e+181) {
tmp = a * (x * -z);
} else if (t <= -850.0) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.15e+181: tmp = a * (x * -z) elif t <= -850.0: tmp = x * (1.0 - (y * t)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.15e+181) tmp = Float64(a * Float64(x * Float64(-z))); elseif (t <= -850.0) tmp = Float64(x * Float64(1.0 - Float64(y * 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 <= -1.15e+181) tmp = a * (x * -z); elseif (t <= -850.0) tmp = x * (1.0 - (y * t)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.15e+181], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -850.0], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{+181}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{elif}\;t \leq -850:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -1.1499999999999999e181Initial program 100.0%
Taylor expanded in y around 0 51.6%
*-commutative51.6%
exp-prod51.6%
exp-diff51.6%
rem-exp-log51.6%
Simplified51.6%
Taylor expanded in b around 0 6.6%
Taylor expanded in z around 0 6.4%
mul-1-neg6.4%
unsub-neg6.4%
Simplified6.4%
Taylor expanded in a around inf 34.6%
mul-1-neg34.6%
distribute-rgt-neg-in34.6%
*-commutative34.6%
distribute-rgt-neg-in34.6%
Simplified34.6%
if -1.1499999999999999e181 < t < -850Initial program 100.0%
Taylor expanded in a around 0 85.6%
Taylor expanded in t around inf 85.6%
mul-1-neg85.6%
distribute-lft-neg-out85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in y around 0 51.2%
mul-1-neg51.2%
unsub-neg51.2%
*-commutative51.2%
Simplified51.2%
if -850 < t Initial program 97.1%
Taylor expanded in a around 0 71.5%
*-commutative71.5%
exp-prod70.0%
exp-diff70.0%
rem-exp-log70.0%
Simplified70.0%
Taylor expanded in t around 0 60.8%
Final simplification56.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x 8.5e-242) (and (not (<= x 6.5e-202)) (<= x 3.6e-128))) (* a (* x (- z))) (* x (- 1.0 (* y t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= 8.5e-242) || (!(x <= 6.5e-202) && (x <= 3.6e-128))) {
tmp = a * (x * -z);
} else {
tmp = x * (1.0 - (y * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x <= 8.5d-242) .or. (.not. (x <= 6.5d-202)) .and. (x <= 3.6d-128)) then
tmp = a * (x * -z)
else
tmp = x * (1.0d0 - (y * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= 8.5e-242) || (!(x <= 6.5e-202) && (x <= 3.6e-128))) {
tmp = a * (x * -z);
} else {
tmp = x * (1.0 - (y * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= 8.5e-242) or (not (x <= 6.5e-202) and (x <= 3.6e-128)): tmp = a * (x * -z) else: tmp = x * (1.0 - (y * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= 8.5e-242) || (!(x <= 6.5e-202) && (x <= 3.6e-128))) tmp = Float64(a * Float64(x * Float64(-z))); else tmp = Float64(x * Float64(1.0 - Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x <= 8.5e-242) || (~((x <= 6.5e-202)) && (x <= 3.6e-128))) tmp = a * (x * -z); else tmp = x * (1.0 - (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, 8.5e-242], And[N[Not[LessEqual[x, 6.5e-202]], $MachinePrecision], LessEqual[x, 3.6e-128]]], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.5 \cdot 10^{-242} \lor \neg \left(x \leq 6.5 \cdot 10^{-202}\right) \land x \leq 3.6 \cdot 10^{-128}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\end{array}
\end{array}
if x < 8.4999999999999997e-242 or 6.49999999999999956e-202 < x < 3.60000000000000025e-128Initial program 98.6%
Taylor expanded in y around 0 63.4%
*-commutative63.4%
exp-prod62.0%
exp-diff62.0%
rem-exp-log62.0%
Simplified62.0%
Taylor expanded in b around 0 21.6%
Taylor expanded in z around 0 21.0%
mul-1-neg21.0%
unsub-neg21.0%
Simplified21.0%
Taylor expanded in a around inf 24.5%
mul-1-neg24.5%
distribute-rgt-neg-in24.5%
*-commutative24.5%
distribute-rgt-neg-in24.5%
Simplified24.5%
if 8.4999999999999997e-242 < x < 6.49999999999999956e-202 or 3.60000000000000025e-128 < x Initial program 96.6%
Taylor expanded in a around 0 74.9%
Taylor expanded in t around inf 61.7%
mul-1-neg61.7%
distribute-lft-neg-out61.7%
*-commutative61.7%
Simplified61.7%
Taylor expanded in y around 0 21.3%
mul-1-neg21.3%
unsub-neg21.3%
*-commutative21.3%
Simplified21.3%
Final simplification23.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* x (- z)))))
(if (<= x 8.5e-242)
t_1
(if (<= x 6.4e-202)
(* x (- 1.0 (* y t)))
(if (<= x 6.6e-128) t_1 (- x (* a (* x b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (x * -z);
double tmp;
if (x <= 8.5e-242) {
tmp = t_1;
} else if (x <= 6.4e-202) {
tmp = x * (1.0 - (y * t));
} else if (x <= 6.6e-128) {
tmp = t_1;
} else {
tmp = x - (a * (x * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (x * -z)
if (x <= 8.5d-242) then
tmp = t_1
else if (x <= 6.4d-202) then
tmp = x * (1.0d0 - (y * t))
else if (x <= 6.6d-128) then
tmp = t_1
else
tmp = x - (a * (x * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (x * -z);
double tmp;
if (x <= 8.5e-242) {
tmp = t_1;
} else if (x <= 6.4e-202) {
tmp = x * (1.0 - (y * t));
} else if (x <= 6.6e-128) {
tmp = t_1;
} else {
tmp = x - (a * (x * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (x * -z) tmp = 0 if x <= 8.5e-242: tmp = t_1 elif x <= 6.4e-202: tmp = x * (1.0 - (y * t)) elif x <= 6.6e-128: tmp = t_1 else: tmp = x - (a * (x * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(x * Float64(-z))) tmp = 0.0 if (x <= 8.5e-242) tmp = t_1; elseif (x <= 6.4e-202) tmp = Float64(x * Float64(1.0 - Float64(y * t))); elseif (x <= 6.6e-128) tmp = t_1; else tmp = Float64(x - Float64(a * Float64(x * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (x * -z); tmp = 0.0; if (x <= 8.5e-242) tmp = t_1; elseif (x <= 6.4e-202) tmp = x * (1.0 - (y * t)); elseif (x <= 6.6e-128) tmp = t_1; else tmp = x - (a * (x * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 8.5e-242], t$95$1, If[LessEqual[x, 6.4e-202], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.6e-128], t$95$1, N[(x - N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{if}\;x \leq 8.5 \cdot 10^{-242}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 6.4 \cdot 10^{-202}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{-128}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if x < 8.4999999999999997e-242 or 6.4000000000000002e-202 < x < 6.6e-128Initial program 98.6%
Taylor expanded in y around 0 63.4%
*-commutative63.4%
exp-prod62.0%
exp-diff62.0%
rem-exp-log62.0%
Simplified62.0%
Taylor expanded in b around 0 21.6%
Taylor expanded in z around 0 21.0%
mul-1-neg21.0%
unsub-neg21.0%
Simplified21.0%
Taylor expanded in a around inf 24.5%
mul-1-neg24.5%
distribute-rgt-neg-in24.5%
*-commutative24.5%
distribute-rgt-neg-in24.5%
Simplified24.5%
if 8.4999999999999997e-242 < x < 6.4000000000000002e-202Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in t around inf 97.0%
mul-1-neg97.0%
distribute-lft-neg-out97.0%
*-commutative97.0%
Simplified97.0%
Taylor expanded in y around 0 48.4%
mul-1-neg48.4%
unsub-neg48.4%
*-commutative48.4%
Simplified48.4%
if 6.6e-128 < x Initial program 96.3%
Taylor expanded in y around 0 53.3%
Taylor expanded in z around 0 53.3%
mul-1-neg53.3%
distribute-rgt-neg-out53.3%
Simplified53.3%
Taylor expanded in a around 0 21.8%
mul-1-neg21.8%
unsub-neg21.8%
*-commutative21.8%
Simplified21.8%
Final simplification24.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.1e-127) (not (<= y 3.75e-34))) (* a (* x (- z))) (* x (- 1.0 (* z a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.1e-127) || !(y <= 3.75e-34)) {
tmp = a * (x * -z);
} else {
tmp = x * (1.0 - (z * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-3.1d-127)) .or. (.not. (y <= 3.75d-34))) then
tmp = a * (x * -z)
else
tmp = x * (1.0d0 - (z * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.1e-127) || !(y <= 3.75e-34)) {
tmp = a * (x * -z);
} else {
tmp = x * (1.0 - (z * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.1e-127) or not (y <= 3.75e-34): tmp = a * (x * -z) else: tmp = x * (1.0 - (z * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.1e-127) || !(y <= 3.75e-34)) tmp = Float64(a * Float64(x * Float64(-z))); else tmp = Float64(x * Float64(1.0 - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -3.1e-127) || ~((y <= 3.75e-34))) tmp = a * (x * -z); else tmp = x * (1.0 - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.1e-127], N[Not[LessEqual[y, 3.75e-34]], $MachinePrecision]], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-127} \lor \neg \left(y \leq 3.75 \cdot 10^{-34}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - z \cdot a\right)\\
\end{array}
\end{array}
if y < -3.1e-127 or 3.7500000000000002e-34 < y Initial program 98.8%
Taylor expanded in y around 0 46.8%
*-commutative46.8%
exp-prod45.4%
exp-diff45.4%
rem-exp-log45.4%
Simplified45.4%
Taylor expanded in b around 0 7.3%
Taylor expanded in z around 0 6.9%
mul-1-neg6.9%
unsub-neg6.9%
Simplified6.9%
Taylor expanded in a around inf 23.0%
mul-1-neg23.0%
distribute-rgt-neg-in23.0%
*-commutative23.0%
distribute-rgt-neg-in23.0%
Simplified23.0%
if -3.1e-127 < y < 3.7500000000000002e-34Initial program 96.3%
Taylor expanded in y around 0 82.0%
*-commutative82.0%
exp-prod71.9%
exp-diff71.9%
rem-exp-log71.9%
Simplified71.9%
Taylor expanded in b around 0 43.4%
Taylor expanded in z around 0 41.5%
mul-1-neg41.5%
unsub-neg41.5%
Simplified41.5%
Final simplification29.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y -5e-101) (* a (- (/ x a) (* x z))) (if (<= y 5e-11) (- x (* a (* x b))) (* a (* x (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5e-101) {
tmp = a * ((x / a) - (x * z));
} else if (y <= 5e-11) {
tmp = x - (a * (x * b));
} else {
tmp = a * (x * -z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-5d-101)) then
tmp = a * ((x / a) - (x * z))
else if (y <= 5d-11) then
tmp = x - (a * (x * b))
else
tmp = a * (x * -z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5e-101) {
tmp = a * ((x / a) - (x * z));
} else if (y <= 5e-11) {
tmp = x - (a * (x * b));
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -5e-101: tmp = a * ((x / a) - (x * z)) elif y <= 5e-11: tmp = x - (a * (x * b)) else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -5e-101) tmp = Float64(a * Float64(Float64(x / a) - Float64(x * z))); elseif (y <= 5e-11) tmp = Float64(x - Float64(a * Float64(x * b))); else tmp = Float64(a * Float64(x * Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -5e-101) tmp = a * ((x / a) - (x * z)); elseif (y <= 5e-11) tmp = x - (a * (x * b)); else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -5e-101], N[(a * N[(N[(x / a), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-11], N[(x - N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-101}:\\
\;\;\;\;a \cdot \left(\frac{x}{a} - x \cdot z\right)\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-11}:\\
\;\;\;\;x - a \cdot \left(x \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -5.0000000000000001e-101Initial program 100.0%
Taylor expanded in y around 0 52.1%
*-commutative52.1%
exp-prod48.4%
exp-diff48.4%
rem-exp-log48.4%
Simplified48.4%
Taylor expanded in b around 0 9.7%
Taylor expanded in z around 0 10.5%
mul-1-neg10.5%
unsub-neg10.5%
Simplified10.5%
Taylor expanded in a around inf 25.6%
+-commutative25.6%
mul-1-neg25.6%
sub-neg25.6%
Simplified25.6%
if -5.0000000000000001e-101 < y < 5.00000000000000018e-11Initial program 95.9%
Taylor expanded in y around 0 79.0%
Taylor expanded in z around 0 78.1%
mul-1-neg78.1%
distribute-rgt-neg-out78.1%
Simplified78.1%
Taylor expanded in a around 0 46.8%
mul-1-neg46.8%
unsub-neg46.8%
*-commutative46.8%
Simplified46.8%
if 5.00000000000000018e-11 < y Initial program 98.5%
Taylor expanded in y around 0 37.9%
*-commutative37.9%
exp-prod39.0%
exp-diff39.0%
rem-exp-log39.0%
Simplified39.0%
Taylor expanded in b around 0 5.1%
Taylor expanded in z around 0 3.4%
mul-1-neg3.4%
unsub-neg3.4%
Simplified3.4%
Taylor expanded in a around inf 27.4%
mul-1-neg27.4%
distribute-rgt-neg-in27.4%
*-commutative27.4%
distribute-rgt-neg-in27.4%
Simplified27.4%
Final simplification35.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4.1e-127) (not (<= y 8e-38))) (* a (* x (- z))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.1e-127) || !(y <= 8e-38)) {
tmp = a * (x * -z);
} 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.1d-127)) .or. (.not. (y <= 8d-38))) then
tmp = a * (x * -z)
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.1e-127) || !(y <= 8e-38)) {
tmp = a * (x * -z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4.1e-127) or not (y <= 8e-38): tmp = a * (x * -z) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4.1e-127) || !(y <= 8e-38)) tmp = Float64(a * Float64(x * Float64(-z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -4.1e-127) || ~((y <= 8e-38))) tmp = a * (x * -z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4.1e-127], N[Not[LessEqual[y, 8e-38]], $MachinePrecision]], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{-127} \lor \neg \left(y \leq 8 \cdot 10^{-38}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.1e-127 or 7.9999999999999997e-38 < y Initial program 98.8%
Taylor expanded in y around 0 46.8%
*-commutative46.8%
exp-prod45.4%
exp-diff45.4%
rem-exp-log45.4%
Simplified45.4%
Taylor expanded in b around 0 7.3%
Taylor expanded in z around 0 6.9%
mul-1-neg6.9%
unsub-neg6.9%
Simplified6.9%
Taylor expanded in a around inf 23.0%
mul-1-neg23.0%
distribute-rgt-neg-in23.0%
*-commutative23.0%
distribute-rgt-neg-in23.0%
Simplified23.0%
if -4.1e-127 < y < 7.9999999999999997e-38Initial program 96.3%
Taylor expanded in y around 0 82.0%
*-commutative82.0%
exp-prod71.9%
exp-diff71.9%
rem-exp-log71.9%
Simplified71.9%
Taylor expanded in a around 0 40.3%
Final simplification29.4%
(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}
Initial program 97.9%
Taylor expanded in y around 0 59.7%
*-commutative59.7%
exp-prod55.1%
exp-diff55.1%
rem-exp-log55.1%
Simplified55.1%
Taylor expanded in a around 0 19.1%
herbie shell --seed 2024087
(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))))))