
(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 15 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 98.1%
Taylor expanded in z around 0 100.0%
+-commutative100.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 (or (<= y -7.8e-189) (not (<= y 1.5e-133))) (* 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 <= -7.8e-189) || !(y <= 1.5e-133)) {
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 <= (-7.8d-189)) .or. (.not. (y <= 1.5d-133))) 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 <= -7.8e-189) || !(y <= 1.5e-133)) {
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 <= -7.8e-189) or not (y <= 1.5e-133): 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 <= -7.8e-189) || !(y <= 1.5e-133)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -7.8e-189) || ~((y <= 1.5e-133))) 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, -7.8e-189], N[Not[LessEqual[y, 1.5e-133]], $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 -7.8 \cdot 10^{-189} \lor \neg \left(y \leq 1.5 \cdot 10^{-133}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\end{array}
\end{array}
if y < -7.8000000000000005e-189 or 1.5000000000000001e-133 < y Initial program 97.9%
fma-define97.9%
sub-neg97.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 86.9%
if -7.8000000000000005e-189 < y < 1.5000000000000001e-133Initial program 98.5%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 95.2%
associate-*r*95.2%
mul-1-neg95.2%
+-commutative95.2%
Simplified95.2%
Final simplification88.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* y (- t))))))
(if (<= t -1600.0)
t_1
(if (<= t -9e-292)
(* x (exp (* a (- b))))
(if (<= t 5e-78) (* x (pow z y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((y * -t));
double tmp;
if (t <= -1600.0) {
tmp = t_1;
} else if (t <= -9e-292) {
tmp = x * exp((a * -b));
} else if (t <= 5e-78) {
tmp = x * pow(z, y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * exp((y * -t))
if (t <= (-1600.0d0)) then
tmp = t_1
else if (t <= (-9d-292)) then
tmp = x * exp((a * -b))
else if (t <= 5d-78) then
tmp = x * (z ** y)
else
tmp = t_1
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 tmp;
if (t <= -1600.0) {
tmp = t_1;
} else if (t <= -9e-292) {
tmp = x * Math.exp((a * -b));
} else if (t <= 5e-78) {
tmp = x * Math.pow(z, y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((y * -t)) tmp = 0 if t <= -1600.0: tmp = t_1 elif t <= -9e-292: tmp = x * math.exp((a * -b)) elif t <= 5e-78: tmp = x * math.pow(z, y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(y * Float64(-t)))) tmp = 0.0 if (t <= -1600.0) tmp = t_1; elseif (t <= -9e-292) tmp = Float64(x * exp(Float64(a * Float64(-b)))); elseif (t <= 5e-78) tmp = Float64(x * (z ^ y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((y * -t)); tmp = 0.0; if (t <= -1600.0) tmp = t_1; elseif (t <= -9e-292) tmp = x * exp((a * -b)); elseif (t <= 5e-78) tmp = x * (z ^ y); else tmp = t_1; 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]}, If[LessEqual[t, -1600.0], t$95$1, If[LessEqual[t, -9e-292], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e-78], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{if}\;t \leq -1600:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -9 \cdot 10^{-292}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-78}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1600 or 4.9999999999999996e-78 < t Initial program 98.1%
fma-define98.1%
sub-neg98.1%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 82.0%
Taylor expanded in t around inf 82.0%
mul-1-neg82.0%
distribute-lft-neg-out82.0%
*-commutative82.0%
Simplified82.0%
if -1600 < t < -8.99999999999999913e-292Initial program 96.4%
fma-define96.4%
sub-neg96.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 69.8%
Taylor expanded in z around 0 69.8%
associate-*r*69.8%
mul-1-neg69.8%
Simplified69.8%
if -8.99999999999999913e-292 < t < 4.9999999999999996e-78Initial program 99.9%
fma-define99.9%
sub-neg99.9%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 81.4%
Taylor expanded in t around 0 81.4%
Final simplification79.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -9e+70) (not (<= t 1.5e+50))) (* x (exp (* y (- t)))) (* x (exp (* a (- (- z) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -9e+70) || !(t <= 1.5e+50)) {
tmp = x * exp((y * -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 ((t <= (-9d+70)) .or. (.not. (t <= 1.5d+50))) then
tmp = x * exp((y * -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 ((t <= -9e+70) || !(t <= 1.5e+50)) {
tmp = x * Math.exp((y * -t));
} else {
tmp = x * Math.exp((a * (-z - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -9e+70) or not (t <= 1.5e+50): tmp = x * math.exp((y * -t)) else: tmp = x * math.exp((a * (-z - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -9e+70) || !(t <= 1.5e+50)) tmp = Float64(x * exp(Float64(y * Float64(-t)))); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -9e+70) || ~((t <= 1.5e+50))) tmp = x * exp((y * -t)); else tmp = x * exp((a * (-z - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -9e+70], N[Not[LessEqual[t, 1.5e+50]], $MachinePrecision]], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+70} \lor \neg \left(t \leq 1.5 \cdot 10^{+50}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\end{array}
\end{array}
if t < -8.9999999999999999e70 or 1.4999999999999999e50 < t Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 86.9%
Taylor expanded in t around inf 86.9%
mul-1-neg86.9%
distribute-lft-neg-out86.9%
*-commutative86.9%
Simplified86.9%
if -8.9999999999999999e70 < t < 1.4999999999999999e50Initial program 96.6%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 74.2%
associate-*r*74.2%
mul-1-neg74.2%
+-commutative74.2%
Simplified74.2%
Final simplification79.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -400.0) (not (<= t 1.3e-76))) (* 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 <= -400.0) || !(t <= 1.3e-76)) {
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 <= (-400.0d0)) .or. (.not. (t <= 1.3d-76))) 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 <= -400.0) || !(t <= 1.3e-76)) {
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 <= -400.0) or not (t <= 1.3e-76): 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 <= -400.0) || !(t <= 1.3e-76)) 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 <= -400.0) || ~((t <= 1.3e-76))) 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, -400.0], N[Not[LessEqual[t, 1.3e-76]], $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 -400 \lor \neg \left(t \leq 1.3 \cdot 10^{-76}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -400 or 1.3e-76 < t Initial program 98.1%
fma-define98.1%
sub-neg98.1%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 82.0%
Taylor expanded in t around inf 82.0%
mul-1-neg82.0%
distribute-lft-neg-out82.0%
*-commutative82.0%
Simplified82.0%
if -400 < t < 1.3e-76Initial program 98.0%
fma-define98.0%
sub-neg98.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 70.3%
Taylor expanded in t around 0 70.3%
Final simplification77.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -9e+25) (not (<= a 5.7e+73))) (* x (pow (- z) a)) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -9e+25) || !(a <= 5.7e+73)) {
tmp = x * pow(-z, a);
} 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 ((a <= (-9d+25)) .or. (.not. (a <= 5.7d+73))) then
tmp = x * (-z ** a)
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 ((a <= -9e+25) || !(a <= 5.7e+73)) {
tmp = x * Math.pow(-z, a);
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -9e+25) or not (a <= 5.7e+73): tmp = x * math.pow(-z, a) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -9e+25) || !(a <= 5.7e+73)) tmp = Float64(x * (Float64(-z) ^ a)); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -9e+25) || ~((a <= 5.7e+73))) tmp = x * (-z ^ a); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -9e+25], N[Not[LessEqual[a, 5.7e+73]], $MachinePrecision]], N[(x * N[Power[(-z), a], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9 \cdot 10^{+25} \lor \neg \left(a \leq 5.7 \cdot 10^{+73}\right):\\
\;\;\;\;x \cdot {\left(-z\right)}^{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if a < -9.0000000000000006e25 or 5.70000000000000001e73 < a Initial program 95.9%
fma-define95.9%
sub-neg95.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 73.1%
Taylor expanded in b around 0 8.6%
Taylor expanded in z around inf 58.4%
neg-mul-158.4%
Simplified58.4%
if -9.0000000000000006e25 < a < 5.70000000000000001e73Initial program 99.3%
fma-define99.3%
sub-neg99.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 87.3%
Taylor expanded in t around 0 57.4%
Final simplification57.8%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.85e+56) (* 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.85e+56) {
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.85d+56)) 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.85e+56) {
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.85e+56: 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.85e+56) 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.85e+56) 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.85e+56], 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.85 \cdot 10^{+56}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -1.84999999999999998e56Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 86.4%
Taylor expanded in t around inf 86.4%
mul-1-neg86.4%
distribute-lft-neg-out86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in y around 0 36.5%
mul-1-neg36.5%
*-commutative36.5%
distribute-rgt-neg-in36.5%
Simplified36.5%
distribute-rgt-neg-out36.5%
unsub-neg36.5%
Applied egg-rr36.5%
if -1.84999999999999998e56 < t Initial program 97.4%
fma-define97.4%
sub-neg97.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 74.3%
Taylor expanded in t around 0 62.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2e+46) (- x (* t (* x y))) (if (<= y 1.9e-143) (- x (* x (* a b))) (* a (* x (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2e+46) {
tmp = x - (t * (x * y));
} else if (y <= 1.9e-143) {
tmp = x - (x * (a * 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 <= (-2d+46)) then
tmp = x - (t * (x * y))
else if (y <= 1.9d-143) then
tmp = x - (x * (a * 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 <= -2e+46) {
tmp = x - (t * (x * y));
} else if (y <= 1.9e-143) {
tmp = x - (x * (a * b));
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2e+46: tmp = x - (t * (x * y)) elif y <= 1.9e-143: tmp = x - (x * (a * b)) else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2e+46) tmp = Float64(x - Float64(t * Float64(x * y))); elseif (y <= 1.9e-143) tmp = Float64(x - Float64(x * Float64(a * 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 <= -2e+46) tmp = x - (t * (x * y)); elseif (y <= 1.9e-143) tmp = x - (x * (a * b)); else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2e+46], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-143], N[(x - N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+46}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-143}:\\
\;\;\;\;x - x \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -2e46Initial program 97.9%
fma-define97.9%
sub-neg97.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 95.9%
Taylor expanded in y around 0 45.5%
associate-*r*43.5%
Simplified43.5%
Taylor expanded in t around inf 34.6%
neg-mul-134.6%
Simplified34.6%
if -2e46 < y < 1.89999999999999991e-143Initial program 98.2%
fma-define98.2%
sub-neg98.2%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 78.9%
Taylor expanded in z around 0 78.9%
associate-*r*78.9%
mul-1-neg78.9%
Simplified78.9%
Taylor expanded in a around 0 38.8%
mul-1-neg38.8%
unsub-neg38.8%
associate-*r*41.4%
*-commutative41.4%
Simplified41.4%
if 1.89999999999999991e-143 < y Initial program 98.0%
fma-define98.0%
sub-neg98.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 42.2%
Taylor expanded in b around 0 12.7%
Taylor expanded in z around 0 9.4%
mul-1-neg9.4%
unsub-neg9.4%
*-commutative9.4%
Simplified9.4%
Taylor expanded in z around inf 32.6%
associate-*r*32.6%
mul-1-neg32.6%
Simplified32.6%
Final simplification36.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.4e+46) (* t (* x (- y))) (if (<= y 1.92e-143) (- x (* x (* a b))) (* a (* x (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.4e+46) {
tmp = t * (x * -y);
} else if (y <= 1.92e-143) {
tmp = x - (x * (a * 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 <= (-2.4d+46)) then
tmp = t * (x * -y)
else if (y <= 1.92d-143) then
tmp = x - (x * (a * 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 <= -2.4e+46) {
tmp = t * (x * -y);
} else if (y <= 1.92e-143) {
tmp = x - (x * (a * b));
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.4e+46: tmp = t * (x * -y) elif y <= 1.92e-143: tmp = x - (x * (a * b)) else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.4e+46) tmp = Float64(t * Float64(x * Float64(-y))); elseif (y <= 1.92e-143) tmp = Float64(x - Float64(x * Float64(a * 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 <= -2.4e+46) tmp = t * (x * -y); elseif (y <= 1.92e-143) tmp = x - (x * (a * b)); else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.4e+46], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.92e-143], N[(x - N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+46}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 1.92 \cdot 10^{-143}:\\
\;\;\;\;x - x \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -2.40000000000000008e46Initial program 97.9%
fma-define97.9%
sub-neg97.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 95.9%
Taylor expanded in t around inf 59.4%
mul-1-neg59.4%
distribute-lft-neg-out59.4%
*-commutative59.4%
Simplified59.4%
Taylor expanded in y around 0 28.9%
mul-1-neg28.9%
*-commutative28.9%
distribute-rgt-neg-in28.9%
Simplified28.9%
Taylor expanded in y around inf 34.4%
associate-*r*34.4%
mul-1-neg34.4%
Simplified34.4%
if -2.40000000000000008e46 < y < 1.91999999999999995e-143Initial program 98.2%
fma-define98.2%
sub-neg98.2%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 78.9%
Taylor expanded in z around 0 78.9%
associate-*r*78.9%
mul-1-neg78.9%
Simplified78.9%
Taylor expanded in a around 0 38.8%
mul-1-neg38.8%
unsub-neg38.8%
associate-*r*41.4%
*-commutative41.4%
Simplified41.4%
if 1.91999999999999995e-143 < y Initial program 98.0%
fma-define98.0%
sub-neg98.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 42.2%
Taylor expanded in b around 0 12.7%
Taylor expanded in z around 0 9.4%
mul-1-neg9.4%
unsub-neg9.4%
*-commutative9.4%
Simplified9.4%
Taylor expanded in z around inf 32.6%
associate-*r*32.6%
mul-1-neg32.6%
Simplified32.6%
Final simplification36.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.26e-71) (not (<= y 1.92e-143))) (* x (* z (- a))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.26e-71) || !(y <= 1.92e-143)) {
tmp = x * (z * -a);
} 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.26d-71)) .or. (.not. (y <= 1.92d-143))) then
tmp = x * (z * -a)
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.26e-71) || !(y <= 1.92e-143)) {
tmp = x * (z * -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.26e-71) or not (y <= 1.92e-143): tmp = x * (z * -a) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.26e-71) || !(y <= 1.92e-143)) tmp = Float64(x * Float64(z * Float64(-a))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.26e-71) || ~((y <= 1.92e-143))) tmp = x * (z * -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.26e-71], N[Not[LessEqual[y, 1.92e-143]], $MachinePrecision]], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.26 \cdot 10^{-71} \lor \neg \left(y \leq 1.92 \cdot 10^{-143}\right):\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.2600000000000001e-71 or 1.91999999999999995e-143 < y Initial program 97.7%
fma-define97.7%
sub-neg97.7%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 42.2%
Taylor expanded in b around 0 10.2%
Taylor expanded in z around 0 9.2%
mul-1-neg9.2%
unsub-neg9.2%
*-commutative9.2%
Simplified9.2%
Taylor expanded in z around inf 23.2%
mul-1-neg23.2%
*-commutative23.2%
distribute-rgt-neg-in23.2%
Simplified23.2%
if -1.2600000000000001e-71 < y < 1.91999999999999995e-143Initial program 98.8%
fma-define98.8%
sub-neg98.8%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 60.8%
Taylor expanded in y around 0 37.8%
Final simplification28.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -9e-60) (* t (* x (- y))) (if (<= y 1.35e-143) x (* a (* x (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -9e-60) {
tmp = t * (x * -y);
} else if (y <= 1.35e-143) {
tmp = x;
} 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 <= (-9d-60)) then
tmp = t * (x * -y)
else if (y <= 1.35d-143) then
tmp = x
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 <= -9e-60) {
tmp = t * (x * -y);
} else if (y <= 1.35e-143) {
tmp = x;
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -9e-60: tmp = t * (x * -y) elif y <= 1.35e-143: tmp = x else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -9e-60) tmp = Float64(t * Float64(x * Float64(-y))); elseif (y <= 1.35e-143) tmp = x; 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 <= -9e-60) tmp = t * (x * -y); elseif (y <= 1.35e-143) tmp = x; else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -9e-60], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e-143], x, N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-60}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-143}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -9.00000000000000001e-60Initial program 97.3%
fma-define97.3%
sub-neg97.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 85.2%
Taylor expanded in t around inf 56.8%
mul-1-neg56.8%
distribute-lft-neg-out56.8%
*-commutative56.8%
Simplified56.8%
Taylor expanded in y around 0 22.7%
mul-1-neg22.7%
*-commutative22.7%
distribute-rgt-neg-in22.7%
Simplified22.7%
Taylor expanded in y around inf 28.4%
associate-*r*28.4%
mul-1-neg28.4%
Simplified28.4%
if -9.00000000000000001e-60 < y < 1.35000000000000005e-143Initial program 98.8%
fma-define98.8%
sub-neg98.8%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 61.2%
Taylor expanded in y around 0 37.4%
if 1.35000000000000005e-143 < y Initial program 98.0%
fma-define98.0%
sub-neg98.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 42.2%
Taylor expanded in b around 0 12.7%
Taylor expanded in z around 0 9.4%
mul-1-neg9.4%
unsub-neg9.4%
*-commutative9.4%
Simplified9.4%
Taylor expanded in z around inf 32.6%
associate-*r*32.6%
mul-1-neg32.6%
Simplified32.6%
Final simplification33.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.6e-59) (* x (* y (- t))) (if (<= y 8.4e-144) x (* a (* x (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.6e-59) {
tmp = x * (y * -t);
} else if (y <= 8.4e-144) {
tmp = x;
} 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 <= (-1.6d-59)) then
tmp = x * (y * -t)
else if (y <= 8.4d-144) then
tmp = x
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 <= -1.6e-59) {
tmp = x * (y * -t);
} else if (y <= 8.4e-144) {
tmp = x;
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.6e-59: tmp = x * (y * -t) elif y <= 8.4e-144: tmp = x else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.6e-59) tmp = Float64(x * Float64(y * Float64(-t))); elseif (y <= 8.4e-144) tmp = x; 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 <= -1.6e-59) tmp = x * (y * -t); elseif (y <= 8.4e-144) tmp = x; else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.6e-59], N[(x * N[(y * (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.4e-144], x, N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-59}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\
\mathbf{elif}\;y \leq 8.4 \cdot 10^{-144}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -1.6e-59Initial program 97.3%
fma-define97.3%
sub-neg97.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 85.2%
Taylor expanded in t around inf 56.8%
mul-1-neg56.8%
distribute-lft-neg-out56.8%
*-commutative56.8%
Simplified56.8%
Taylor expanded in y around 0 22.7%
mul-1-neg22.7%
*-commutative22.7%
distribute-rgt-neg-in22.7%
Simplified22.7%
Taylor expanded in y around inf 23.1%
associate-*r*23.1%
mul-1-neg23.1%
Simplified23.1%
if -1.6e-59 < y < 8.4000000000000005e-144Initial program 98.8%
fma-define98.8%
sub-neg98.8%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 61.2%
Taylor expanded in y around 0 37.4%
if 8.4000000000000005e-144 < y Initial program 98.0%
fma-define98.0%
sub-neg98.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 42.2%
Taylor expanded in b around 0 12.7%
Taylor expanded in z around 0 9.4%
mul-1-neg9.4%
unsub-neg9.4%
*-commutative9.4%
Simplified9.4%
Taylor expanded in z around inf 32.6%
associate-*r*32.6%
mul-1-neg32.6%
Simplified32.6%
Final simplification31.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -6.8e-60) (* x (* y (- t))) (if (<= y 1.92e-143) x (* x (* z (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6.8e-60) {
tmp = x * (y * -t);
} else if (y <= 1.92e-143) {
tmp = x;
} else {
tmp = x * (z * -a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-6.8d-60)) then
tmp = x * (y * -t)
else if (y <= 1.92d-143) then
tmp = x
else
tmp = x * (z * -a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6.8e-60) {
tmp = x * (y * -t);
} else if (y <= 1.92e-143) {
tmp = x;
} else {
tmp = x * (z * -a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -6.8e-60: tmp = x * (y * -t) elif y <= 1.92e-143: tmp = x else: tmp = x * (z * -a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -6.8e-60) tmp = Float64(x * Float64(y * Float64(-t))); elseif (y <= 1.92e-143) tmp = x; else tmp = Float64(x * Float64(z * Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -6.8e-60) tmp = x * (y * -t); elseif (y <= 1.92e-143) tmp = x; else tmp = x * (z * -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -6.8e-60], N[(x * N[(y * (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.92e-143], x, N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{-60}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\
\mathbf{elif}\;y \leq 1.92 \cdot 10^{-143}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if y < -6.80000000000000013e-60Initial program 97.3%
fma-define97.3%
sub-neg97.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 85.2%
Taylor expanded in t around inf 56.8%
mul-1-neg56.8%
distribute-lft-neg-out56.8%
*-commutative56.8%
Simplified56.8%
Taylor expanded in y around 0 22.7%
mul-1-neg22.7%
*-commutative22.7%
distribute-rgt-neg-in22.7%
Simplified22.7%
Taylor expanded in y around inf 23.1%
associate-*r*23.1%
mul-1-neg23.1%
Simplified23.1%
if -6.80000000000000013e-60 < y < 1.91999999999999995e-143Initial program 98.8%
fma-define98.8%
sub-neg98.8%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 61.2%
Taylor expanded in y around 0 37.4%
if 1.91999999999999995e-143 < y Initial program 98.0%
fma-define98.0%
sub-neg98.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 42.2%
Taylor expanded in b around 0 12.7%
Taylor expanded in z around 0 9.4%
mul-1-neg9.4%
unsub-neg9.4%
*-commutative9.4%
Simplified9.4%
Taylor expanded in z around inf 28.1%
mul-1-neg28.1%
*-commutative28.1%
distribute-rgt-neg-in28.1%
Simplified28.1%
Final simplification29.8%
(FPCore (x y z t a b) :precision binary64 (if (<= x 2.25e-63) (* 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 <= 2.25e-63) {
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 <= 2.25d-63) 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 <= 2.25e-63) {
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 <= 2.25e-63: 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 <= 2.25e-63) 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 <= 2.25e-63) tmp = a * (x * -z); else tmp = x * (1.0 - (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 2.25e-63], 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 2.25 \cdot 10^{-63}:\\
\;\;\;\;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 < 2.25e-63Initial program 98.2%
fma-define98.2%
sub-neg98.2%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 56.8%
Taylor expanded in b around 0 19.8%
Taylor expanded in z around 0 19.0%
mul-1-neg19.0%
unsub-neg19.0%
*-commutative19.0%
Simplified19.0%
Taylor expanded in z around inf 27.7%
associate-*r*27.7%
mul-1-neg27.7%
Simplified27.7%
if 2.25e-63 < x Initial program 97.7%
fma-define97.7%
sub-neg97.7%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 80.2%
Taylor expanded in t around inf 64.6%
mul-1-neg64.6%
distribute-lft-neg-out64.6%
*-commutative64.6%
Simplified64.6%
Taylor expanded in y around 0 29.4%
mul-1-neg29.4%
*-commutative29.4%
distribute-rgt-neg-in29.4%
Simplified29.4%
distribute-rgt-neg-out29.4%
unsub-neg29.4%
Applied egg-rr29.4%
Final simplification28.3%
(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 98.1%
fma-define98.1%
sub-neg98.1%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 77.4%
Taylor expanded in y around 0 17.6%
herbie shell --seed 2024146
(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))))))