
(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 97.3%
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 (or (<= y -3.5e-92) (not (<= y 5.6e-74))) (* x (exp (* y (- (log z) t)))) (* x (exp (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.5e-92) || !(y <= 5.6e-74)) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x * exp((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 ((y <= (-3.5d-92)) .or. (.not. (y <= 5.6d-74))) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = x * exp((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 ((y <= -3.5e-92) || !(y <= 5.6e-74)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * (Math.log((1.0 - z)) - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.5e-92) or not (y <= 5.6e-74): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * (math.log((1.0 - z)) - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.5e-92) || !(y <= 5.6e-74)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(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 ((y <= -3.5e-92) || ~((y <= 5.6e-74))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((a * (log((1.0 - z)) - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.5e-92], N[Not[LessEqual[y, 5.6e-74]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-92} \lor \neg \left(y \leq 5.6 \cdot 10^{-74}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right)}\\
\end{array}
\end{array}
if y < -3.5e-92 or 5.59999999999999976e-74 < y Initial program 97.6%
fma-define97.6%
sub-neg97.6%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 87.3%
if -3.5e-92 < y < 5.59999999999999976e-74Initial program 96.9%
fma-define96.9%
sub-neg96.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 90.1%
Final simplification88.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4.3e-94) (not (<= y 9.2e-75))) (* x (exp (* y (- (log z) t)))) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.3e-94) || !(y <= 9.2e-75)) {
tmp = x * exp((y * (log(z) - t)));
} 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 <= (-4.3d-94)) .or. (.not. (y <= 9.2d-75))) then
tmp = x * exp((y * (log(z) - t)))
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 <= -4.3e-94) || !(y <= 9.2e-75)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4.3e-94) or not (y <= 9.2e-75): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4.3e-94) || !(y <= 9.2e-75)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); 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 <= -4.3e-94) || ~((y <= 9.2e-75))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4.3e-94], N[Not[LessEqual[y, 9.2e-75]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.3 \cdot 10^{-94} \lor \neg \left(y \leq 9.2 \cdot 10^{-75}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -4.2999999999999998e-94 or 9.2e-75 < y Initial program 97.6%
fma-define97.6%
sub-neg97.6%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 86.8%
if -4.2999999999999998e-94 < y < 9.2e-75Initial program 96.8%
fma-define96.8%
sub-neg96.8%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 89.9%
Taylor expanded in z around 0 88.9%
associate-*r*88.9%
mul-1-neg88.9%
Simplified88.9%
Final simplification87.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))))
(if (<= y -1.1e-23)
t_1
(if (<= y -5.5e-93)
(* x (exp (* y (- t))))
(if (<= y 7.4e-6) (* x (exp (* a (- b)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * pow(z, y);
double tmp;
if (y <= -1.1e-23) {
tmp = t_1;
} else if (y <= -5.5e-93) {
tmp = x * exp((y * -t));
} else if (y <= 7.4e-6) {
tmp = x * exp((a * -b));
} 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 * (z ** y)
if (y <= (-1.1d-23)) then
tmp = t_1
else if (y <= (-5.5d-93)) then
tmp = x * exp((y * -t))
else if (y <= 7.4d-6) then
tmp = x * exp((a * -b))
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.pow(z, y);
double tmp;
if (y <= -1.1e-23) {
tmp = t_1;
} else if (y <= -5.5e-93) {
tmp = x * Math.exp((y * -t));
} else if (y <= 7.4e-6) {
tmp = x * Math.exp((a * -b));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.pow(z, y) tmp = 0 if y <= -1.1e-23: tmp = t_1 elif y <= -5.5e-93: tmp = x * math.exp((y * -t)) elif y <= 7.4e-6: tmp = x * math.exp((a * -b)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) tmp = 0.0 if (y <= -1.1e-23) tmp = t_1; elseif (y <= -5.5e-93) tmp = Float64(x * exp(Float64(y * Float64(-t)))); elseif (y <= 7.4e-6) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (z ^ y); tmp = 0.0; if (y <= -1.1e-23) tmp = t_1; elseif (y <= -5.5e-93) tmp = x * exp((y * -t)); elseif (y <= 7.4e-6) tmp = x * exp((a * -b)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.1e-23], t$95$1, If[LessEqual[y, -5.5e-93], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.4e-6], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{-23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{-93}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-6}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.1e-23 or 7.4000000000000003e-6 < y Initial program 98.4%
fma-define98.4%
sub-neg98.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 90.5%
Taylor expanded in t around 0 72.2%
if -1.1e-23 < y < -5.49999999999999968e-93Initial program 100.0%
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%
Taylor expanded in t around inf 82.7%
associate-*r*82.7%
neg-mul-182.7%
Simplified82.7%
if -5.49999999999999968e-93 < y < 7.4000000000000003e-6Initial program 95.7%
fma-define95.7%
sub-neg95.7%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 86.8%
Taylor expanded in z around 0 85.1%
associate-*r*85.1%
mul-1-neg85.1%
Simplified85.1%
Final simplification78.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -19500000000000.0) (not (<= y 7.6e-6))) (* 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 <= -19500000000000.0) || !(y <= 7.6e-6)) {
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 <= (-19500000000000.0d0)) .or. (.not. (y <= 7.6d-6))) 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 <= -19500000000000.0) || !(y <= 7.6e-6)) {
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 <= -19500000000000.0) or not (y <= 7.6e-6): 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 <= -19500000000000.0) || !(y <= 7.6e-6)) 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 <= -19500000000000.0) || ~((y <= 7.6e-6))) 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, -19500000000000.0], N[Not[LessEqual[y, 7.6e-6]], $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 -19500000000000 \lor \neg \left(y \leq 7.6 \cdot 10^{-6}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -1.95e13 or 7.6000000000000001e-6 < y Initial program 98.3%
fma-define98.3%
sub-neg98.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 93.4%
Taylor expanded in t around 0 73.5%
if -1.95e13 < y < 7.6000000000000001e-6Initial program 96.4%
fma-define96.4%
sub-neg96.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 81.1%
Taylor expanded in z around 0 79.0%
associate-*r*79.0%
mul-1-neg79.0%
Simplified79.0%
Final simplification76.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -8.5e-60) (not (<= y 1.15e-71))) (* x (pow z y)) (* x (- 1.0 (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8.5e-60) || !(y <= 1.15e-71)) {
tmp = x * pow(z, y);
} else {
tmp = x * (1.0 - (a * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-8.5d-60)) .or. (.not. (y <= 1.15d-71))) then
tmp = x * (z ** y)
else
tmp = x * (1.0d0 - (a * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8.5e-60) || !(y <= 1.15e-71)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * (1.0 - (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -8.5e-60) or not (y <= 1.15e-71): tmp = x * math.pow(z, y) else: tmp = x * (1.0 - (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -8.5e-60) || !(y <= 1.15e-71)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * Float64(1.0 - Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -8.5e-60) || ~((y <= 1.15e-71))) tmp = x * (z ^ y); else tmp = x * (1.0 - (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8.5e-60], N[Not[LessEqual[y, 1.15e-71]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{-60} \lor \neg \left(y \leq 1.15 \cdot 10^{-71}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\end{array}
\end{array}
if y < -8.50000000000000044e-60 or 1.1499999999999999e-71 < y Initial program 97.3%
fma-define97.3%
sub-neg97.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 88.1%
Taylor expanded in t around 0 65.7%
if -8.50000000000000044e-60 < y < 1.1499999999999999e-71Initial program 97.3%
fma-define97.3%
sub-neg97.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 86.0%
Taylor expanded in z around 0 83.3%
associate-*r*83.3%
mul-1-neg83.3%
Simplified83.3%
Taylor expanded in a around 0 46.6%
mul-1-neg46.6%
associate-*r*50.0%
distribute-lft-neg-in50.0%
neg-mul-150.0%
distribute-rgt1-in50.0%
+-commutative50.0%
neg-mul-150.0%
unsub-neg50.0%
Simplified50.0%
Final simplification59.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.7e-88) (- x (* t (* x y))) (if (<= y 2.8) (* x (- 1.0 (* a b))) (* x (* a (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.7e-88) {
tmp = x - (t * (x * y));
} else if (y <= 2.8) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (a * -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.7d-88)) then
tmp = x - (t * (x * y))
else if (y <= 2.8d0) then
tmp = x * (1.0d0 - (a * b))
else
tmp = x * (a * -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.7e-88) {
tmp = x - (t * (x * y));
} else if (y <= 2.8) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (a * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.7e-88: tmp = x - (t * (x * y)) elif y <= 2.8: tmp = x * (1.0 - (a * b)) else: tmp = x * (a * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.7e-88) tmp = Float64(x - Float64(t * Float64(x * y))); elseif (y <= 2.8) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(x * Float64(a * Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.7e-88) tmp = x - (t * (x * y)); elseif (y <= 2.8) tmp = x * (1.0 - (a * b)); else tmp = x * (a * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.7e-88], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(a * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-88}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;y \leq 2.8:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -2.69999999999999995e-88Initial program 97.1%
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%
Taylor expanded in t around inf 56.4%
associate-*r*56.4%
neg-mul-156.4%
Simplified56.4%
Taylor expanded in t around 0 27.2%
associate-*r*27.2%
mul-1-neg27.2%
Simplified27.2%
if -2.69999999999999995e-88 < y < 2.7999999999999998Initial program 95.9%
fma-define95.9%
sub-neg95.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 84.6%
Taylor expanded in z around 0 83.0%
associate-*r*83.0%
mul-1-neg83.0%
Simplified83.0%
Taylor expanded in a around 0 44.9%
mul-1-neg44.9%
associate-*r*48.1%
distribute-lft-neg-in48.1%
neg-mul-148.1%
distribute-rgt1-in48.1%
+-commutative48.1%
neg-mul-148.1%
unsub-neg48.1%
Simplified48.1%
if 2.7999999999999998 < y Initial program 100.0%
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%
Taylor expanded in z around inf 11.8%
associate-*r*11.8%
mul-1-neg11.8%
Simplified11.8%
Taylor expanded in a around 0 3.6%
neg-mul-13.6%
unsub-neg3.6%
Simplified3.6%
Taylor expanded in a around inf 28.4%
mul-1-neg28.4%
*-commutative28.4%
distribute-rgt-neg-in28.4%
Simplified28.4%
Final simplification37.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -6.2e-98) (- x (* y (* x t))) (if (<= y 0.00013) (* x (- 1.0 (* a b))) (* x (* a (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6.2e-98) {
tmp = x - (y * (x * t));
} else if (y <= 0.00013) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (a * -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.2d-98)) then
tmp = x - (y * (x * t))
else if (y <= 0.00013d0) then
tmp = x * (1.0d0 - (a * b))
else
tmp = x * (a * -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.2e-98) {
tmp = x - (y * (x * t));
} else if (y <= 0.00013) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (a * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -6.2e-98: tmp = x - (y * (x * t)) elif y <= 0.00013: tmp = x * (1.0 - (a * b)) else: tmp = x * (a * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -6.2e-98) tmp = Float64(x - Float64(y * Float64(x * t))); elseif (y <= 0.00013) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(x * Float64(a * Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -6.2e-98) tmp = x - (y * (x * t)); elseif (y <= 0.00013) tmp = x * (1.0 - (a * b)); else tmp = x * (a * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -6.2e-98], N[(x - N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.00013], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(a * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{-98}:\\
\;\;\;\;x - y \cdot \left(x \cdot t\right)\\
\mathbf{elif}\;y \leq 0.00013:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -6.2e-98Initial program 97.2%
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%
Taylor expanded in t around inf 57.5%
associate-*r*57.5%
neg-mul-157.5%
Simplified57.5%
Taylor expanded in t around 0 25.9%
mul-1-neg25.9%
unsub-neg25.9%
associate-*r*27.2%
*-commutative27.2%
*-commutative27.2%
Simplified27.2%
if -6.2e-98 < y < 1.29999999999999989e-4Initial program 95.8%
fma-define95.8%
sub-neg95.8%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 84.9%
Taylor expanded in z around 0 83.2%
associate-*r*83.2%
mul-1-neg83.2%
Simplified83.2%
Taylor expanded in a around 0 45.5%
mul-1-neg45.5%
associate-*r*48.8%
distribute-lft-neg-in48.8%
neg-mul-148.8%
distribute-rgt1-in48.8%
+-commutative48.8%
neg-mul-148.8%
unsub-neg48.8%
Simplified48.8%
if 1.29999999999999989e-4 < y Initial program 100.0%
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%
Taylor expanded in z around inf 11.8%
associate-*r*11.8%
mul-1-neg11.8%
Simplified11.8%
Taylor expanded in a around 0 3.6%
neg-mul-13.6%
unsub-neg3.6%
Simplified3.6%
Taylor expanded in a around inf 28.4%
mul-1-neg28.4%
*-commutative28.4%
distribute-rgt-neg-in28.4%
Simplified28.4%
Final simplification37.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.5e-88) (* x (- 1.0 (* y t))) (if (<= y 0.027) (* x (- 1.0 (* a b))) (* x (* a (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.5e-88) {
tmp = x * (1.0 - (y * t));
} else if (y <= 0.027) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (a * -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.5d-88)) then
tmp = x * (1.0d0 - (y * t))
else if (y <= 0.027d0) then
tmp = x * (1.0d0 - (a * b))
else
tmp = x * (a * -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.5e-88) {
tmp = x * (1.0 - (y * t));
} else if (y <= 0.027) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (a * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.5e-88: tmp = x * (1.0 - (y * t)) elif y <= 0.027: tmp = x * (1.0 - (a * b)) else: tmp = x * (a * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.5e-88) tmp = Float64(x * Float64(1.0 - Float64(y * t))); elseif (y <= 0.027) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(x * Float64(a * Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.5e-88) tmp = x * (1.0 - (y * t)); elseif (y <= 0.027) tmp = x * (1.0 - (a * b)); else tmp = x * (a * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.5e-88], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.027], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(a * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-88}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{elif}\;y \leq 0.027:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -2.50000000000000004e-88Initial program 97.1%
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%
Taylor expanded in t around inf 56.4%
associate-*r*56.4%
neg-mul-156.4%
Simplified56.4%
Taylor expanded in t around 0 24.6%
mul-1-neg24.6%
*-commutative24.6%
unsub-neg24.6%
Simplified24.6%
if -2.50000000000000004e-88 < y < 0.0269999999999999997Initial program 95.9%
fma-define95.9%
sub-neg95.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 84.6%
Taylor expanded in z around 0 83.0%
associate-*r*83.0%
mul-1-neg83.0%
Simplified83.0%
Taylor expanded in a around 0 44.9%
mul-1-neg44.9%
associate-*r*48.1%
distribute-lft-neg-in48.1%
neg-mul-148.1%
distribute-rgt1-in48.1%
+-commutative48.1%
neg-mul-148.1%
unsub-neg48.1%
Simplified48.1%
if 0.0269999999999999997 < y Initial program 100.0%
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%
Taylor expanded in z around inf 11.8%
associate-*r*11.8%
mul-1-neg11.8%
Simplified11.8%
Taylor expanded in a around 0 3.6%
neg-mul-13.6%
unsub-neg3.6%
Simplified3.6%
Taylor expanded in a around inf 28.4%
mul-1-neg28.4%
*-commutative28.4%
distribute-rgt-neg-in28.4%
Simplified28.4%
Final simplification36.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.1e-23) (* x (* a (- b))) (if (<= y 9.4e-5) (* x (- 1.0 (* z a))) (* x (* a (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.1e-23) {
tmp = x * (a * -b);
} else if (y <= 9.4e-5) {
tmp = x * (1.0 - (z * a));
} else {
tmp = x * (a * -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.1d-23)) then
tmp = x * (a * -b)
else if (y <= 9.4d-5) then
tmp = x * (1.0d0 - (z * a))
else
tmp = x * (a * -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.1e-23) {
tmp = x * (a * -b);
} else if (y <= 9.4e-5) {
tmp = x * (1.0 - (z * a));
} else {
tmp = x * (a * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.1e-23: tmp = x * (a * -b) elif y <= 9.4e-5: tmp = x * (1.0 - (z * a)) else: tmp = x * (a * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.1e-23) tmp = Float64(x * Float64(a * Float64(-b))); elseif (y <= 9.4e-5) tmp = Float64(x * Float64(1.0 - Float64(z * a))); else tmp = Float64(x * Float64(a * Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.1e-23) tmp = x * (a * -b); elseif (y <= 9.4e-5) tmp = x * (1.0 - (z * a)); else tmp = x * (a * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.1e-23], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.4e-5], N[(x * N[(1.0 - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(a * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-23}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 9.4 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \left(1 - z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -1.1e-23Initial program 96.1%
fma-define96.1%
sub-neg96.1%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 45.3%
Taylor expanded in z around 0 45.3%
associate-*r*45.3%
mul-1-neg45.3%
Simplified45.3%
Taylor expanded in a around 0 12.9%
mul-1-neg12.9%
associate-*r*14.9%
distribute-lft-neg-in14.9%
neg-mul-114.9%
distribute-rgt1-in14.9%
+-commutative14.9%
neg-mul-114.9%
unsub-neg14.9%
Simplified14.9%
Taylor expanded in a around inf 19.5%
mul-1-neg19.5%
*-commutative19.5%
distribute-rgt-neg-in19.5%
Simplified19.5%
if -1.1e-23 < y < 9.39999999999999945e-5Initial program 96.4%
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%
Taylor expanded in z around inf 51.6%
associate-*r*51.6%
mul-1-neg51.6%
Simplified51.6%
Taylor expanded in a around 0 36.0%
neg-mul-136.0%
unsub-neg36.0%
Simplified36.0%
if 9.39999999999999945e-5 < y Initial program 100.0%
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%
Taylor expanded in z around inf 11.8%
associate-*r*11.8%
mul-1-neg11.8%
Simplified11.8%
Taylor expanded in a around 0 3.6%
neg-mul-13.6%
unsub-neg3.6%
Simplified3.6%
Taylor expanded in a around inf 28.4%
mul-1-neg28.4%
*-commutative28.4%
distribute-rgt-neg-in28.4%
Simplified28.4%
Final simplification30.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -60000000.0) (not (<= y 0.00092))) (* x (* a (- z))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -60000000.0) || !(y <= 0.00092)) {
tmp = x * (a * -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 <= (-60000000.0d0)) .or. (.not. (y <= 0.00092d0))) then
tmp = x * (a * -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 <= -60000000.0) || !(y <= 0.00092)) {
tmp = x * (a * -z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -60000000.0) or not (y <= 0.00092): tmp = x * (a * -z) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -60000000.0) || !(y <= 0.00092)) tmp = Float64(x * Float64(a * Float64(-z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -60000000.0) || ~((y <= 0.00092))) tmp = x * (a * -z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -60000000.0], N[Not[LessEqual[y, 0.00092]], $MachinePrecision]], N[(x * N[(a * (-z)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -60000000 \lor \neg \left(y \leq 0.00092\right):\\
\;\;\;\;x \cdot \left(a \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -6e7 or 9.2000000000000003e-4 < y Initial program 98.3%
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%
Taylor expanded in z around inf 15.9%
associate-*r*15.9%
mul-1-neg15.9%
Simplified15.9%
Taylor expanded in a around 0 4.4%
neg-mul-14.4%
unsub-neg4.4%
Simplified4.4%
Taylor expanded in a around inf 22.7%
mul-1-neg22.7%
*-commutative22.7%
distribute-rgt-neg-in22.7%
Simplified22.7%
if -6e7 < y < 9.2000000000000003e-4Initial program 96.5%
fma-define96.5%
sub-neg96.5%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 79.7%
Taylor expanded in a around 0 34.3%
Final simplification29.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y -7.8e-25) (* x (* a (- b))) (if (<= y 3e-5) x (* x (* a (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7.8e-25) {
tmp = x * (a * -b);
} else if (y <= 3e-5) {
tmp = x;
} else {
tmp = x * (a * -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 <= (-7.8d-25)) then
tmp = x * (a * -b)
else if (y <= 3d-5) then
tmp = x
else
tmp = x * (a * -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 <= -7.8e-25) {
tmp = x * (a * -b);
} else if (y <= 3e-5) {
tmp = x;
} else {
tmp = x * (a * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -7.8e-25: tmp = x * (a * -b) elif y <= 3e-5: tmp = x else: tmp = x * (a * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7.8e-25) tmp = Float64(x * Float64(a * Float64(-b))); elseif (y <= 3e-5) tmp = x; else tmp = Float64(x * Float64(a * Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -7.8e-25) tmp = x * (a * -b); elseif (y <= 3e-5) tmp = x; else tmp = x * (a * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7.8e-25], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e-5], x, N[(x * N[(a * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{-25}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-5}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -7.8e-25Initial program 96.1%
fma-define96.1%
sub-neg96.1%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 45.3%
Taylor expanded in z around 0 45.3%
associate-*r*45.3%
mul-1-neg45.3%
Simplified45.3%
Taylor expanded in a around 0 12.9%
mul-1-neg12.9%
associate-*r*14.9%
distribute-lft-neg-in14.9%
neg-mul-114.9%
distribute-rgt1-in14.9%
+-commutative14.9%
neg-mul-114.9%
unsub-neg14.9%
Simplified14.9%
Taylor expanded in a around inf 19.5%
mul-1-neg19.5%
*-commutative19.5%
distribute-rgt-neg-in19.5%
Simplified19.5%
if -7.8e-25 < y < 3.00000000000000008e-5Initial program 96.4%
fma-define96.4%
sub-neg96.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 80.0%
Taylor expanded in a around 0 34.9%
if 3.00000000000000008e-5 < y Initial program 100.0%
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%
Taylor expanded in z around inf 11.8%
associate-*r*11.8%
mul-1-neg11.8%
Simplified11.8%
Taylor expanded in a around 0 3.6%
neg-mul-13.6%
unsub-neg3.6%
Simplified3.6%
Taylor expanded in a around inf 28.4%
mul-1-neg28.4%
*-commutative28.4%
distribute-rgt-neg-in28.4%
Simplified28.4%
Final simplification30.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -8.5e-24) (* a (* x (- b))) (if (<= y 3.1e-5) x (* x (* a (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -8.5e-24) {
tmp = a * (x * -b);
} else if (y <= 3.1e-5) {
tmp = x;
} else {
tmp = x * (a * -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 <= (-8.5d-24)) then
tmp = a * (x * -b)
else if (y <= 3.1d-5) then
tmp = x
else
tmp = x * (a * -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 <= -8.5e-24) {
tmp = a * (x * -b);
} else if (y <= 3.1e-5) {
tmp = x;
} else {
tmp = x * (a * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -8.5e-24: tmp = a * (x * -b) elif y <= 3.1e-5: tmp = x else: tmp = x * (a * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -8.5e-24) tmp = Float64(a * Float64(x * Float64(-b))); elseif (y <= 3.1e-5) tmp = x; else tmp = Float64(x * Float64(a * Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -8.5e-24) tmp = a * (x * -b); elseif (y <= 3.1e-5) tmp = x; else tmp = x * (a * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -8.5e-24], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.1e-5], x, N[(x * N[(a * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{-24}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-5}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -8.5000000000000002e-24Initial program 96.1%
fma-define96.1%
sub-neg96.1%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 45.3%
Taylor expanded in z around 0 45.3%
associate-*r*45.3%
mul-1-neg45.3%
Simplified45.3%
Taylor expanded in a around 0 12.9%
mul-1-neg12.9%
associate-*r*14.9%
distribute-lft-neg-in14.9%
neg-mul-114.9%
distribute-rgt1-in14.9%
+-commutative14.9%
neg-mul-114.9%
unsub-neg14.9%
Simplified14.9%
Taylor expanded in a around inf 17.8%
associate-*r*17.8%
neg-mul-117.8%
*-commutative17.8%
Simplified17.8%
if -8.5000000000000002e-24 < y < 3.10000000000000014e-5Initial program 96.4%
fma-define96.4%
sub-neg96.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 80.0%
Taylor expanded in a around 0 34.9%
if 3.10000000000000014e-5 < y Initial program 100.0%
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%
Taylor expanded in z around inf 11.8%
associate-*r*11.8%
mul-1-neg11.8%
Simplified11.8%
Taylor expanded in a around 0 3.6%
neg-mul-13.6%
unsub-neg3.6%
Simplified3.6%
Taylor expanded in a around inf 28.4%
mul-1-neg28.4%
*-commutative28.4%
distribute-rgt-neg-in28.4%
Simplified28.4%
Final simplification29.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y 0.85) (* x (- 1.0 (* y t))) (* x (* a (- z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 0.85) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * (a * -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 <= 0.85d0) then
tmp = x * (1.0d0 - (y * t))
else
tmp = x * (a * -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 <= 0.85) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * (a * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 0.85: tmp = x * (1.0 - (y * t)) else: tmp = x * (a * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 0.85) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(x * Float64(a * Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 0.85) tmp = x * (1.0 - (y * t)); else tmp = x * (a * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 0.85], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(a * (-z)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.85:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < 0.849999999999999978Initial program 96.3%
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%
Taylor expanded in t around inf 55.9%
associate-*r*55.9%
neg-mul-155.9%
Simplified55.9%
Taylor expanded in t around 0 33.6%
mul-1-neg33.6%
*-commutative33.6%
unsub-neg33.6%
Simplified33.6%
if 0.849999999999999978 < y Initial program 100.0%
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%
Taylor expanded in z around inf 11.8%
associate-*r*11.8%
mul-1-neg11.8%
Simplified11.8%
Taylor expanded in a around 0 3.6%
neg-mul-13.6%
unsub-neg3.6%
Simplified3.6%
Taylor expanded in a around inf 28.4%
mul-1-neg28.4%
*-commutative28.4%
distribute-rgt-neg-in28.4%
Simplified28.4%
Final simplification32.2%
(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.3%
fma-define97.3%
sub-neg97.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 58.8%
Taylor expanded in a around 0 20.3%
herbie shell --seed 2024185
(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))))))