
(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 14 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 (fma y (- (log z) t) (* a (- (log1p (- z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(y, (log(z) - t), (a * (log1p(-z) - b))));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(y, Float64(log(z) - t), Float64(a * Float64(log1p(Float64(-z)) - b))))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}
\end{array}
Initial program 95.4%
fma-define96.1%
sub-neg96.1%
log1p-define100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a b) :precision binary64 (if (<= a -3e+237) (* x (exp (* a (- (- b) z)))) (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3e+237) {
tmp = x * exp((a * (-b - z)));
} else {
tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-3d+237)) then
tmp = x * exp((a * (-b - z)))
else
tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3e+237) {
tmp = x * Math.exp((a * (-b - z)));
} else {
tmp = x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -3e+237: tmp = x * math.exp((a * (-b - z))) else: tmp = x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -3e+237) tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); else tmp = Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -3e+237) tmp = x * exp((a * (-b - z))); else tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3e+237], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+237}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\\
\end{array}
\end{array}
if a < -3e237Initial program 60.5%
Taylor expanded in y around 0 67.2%
sub-neg67.2%
mul-1-neg67.2%
log1p-define93.4%
mul-1-neg93.4%
Simplified93.4%
Taylor expanded in z around 0 93.4%
+-commutative93.4%
associate-*r*93.4%
associate-*r*93.4%
distribute-lft-out93.4%
neg-mul-193.4%
Simplified93.4%
if -3e237 < a Initial program 97.5%
Final simplification97.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -4e-22) (not (<= a 2.2e+33))) (* 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 ((a <= -4e-22) || !(a <= 2.2e+33)) {
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 ((a <= (-4d-22)) .or. (.not. (a <= 2.2d+33))) 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 ((a <= -4e-22) || !(a <= 2.2e+33)) {
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 (a <= -4e-22) or not (a <= 2.2e+33): 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 ((a <= -4e-22) || !(a <= 2.2e+33)) 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 ((a <= -4e-22) || ~((a <= 2.2e+33))) 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[Or[LessEqual[a, -4e-22], N[Not[LessEqual[a, 2.2e+33]], $MachinePrecision]], 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}\;a \leq -4 \cdot 10^{-22} \lor \neg \left(a \leq 2.2 \cdot 10^{+33}\right):\\
\;\;\;\;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 a < -4.0000000000000002e-22 or 2.19999999999999994e33 < a Initial program 90.1%
Taylor expanded in y around 0 74.7%
sub-neg74.7%
mul-1-neg74.7%
log1p-define84.4%
mul-1-neg84.4%
Simplified84.4%
Taylor expanded in z around 0 84.4%
+-commutative84.4%
associate-*r*84.4%
associate-*r*84.4%
distribute-lft-out84.4%
neg-mul-184.4%
Simplified84.4%
if -4.0000000000000002e-22 < a < 2.19999999999999994e33Initial program 99.9%
Taylor expanded in y around inf 92.4%
Final simplification88.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))))
(if (<= y -0.046)
t_1
(if (<= y 0.235)
(* x (exp (* a (- b))))
(if (<= y 6e+71) t_1 (* x (exp (* t (- y)))))))))
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 <= -0.046) {
tmp = t_1;
} else if (y <= 0.235) {
tmp = x * exp((a * -b));
} else if (y <= 6e+71) {
tmp = t_1;
} else {
tmp = x * exp((t * -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) :: t_1
real(8) :: tmp
t_1 = x * (z ** y)
if (y <= (-0.046d0)) then
tmp = t_1
else if (y <= 0.235d0) then
tmp = x * exp((a * -b))
else if (y <= 6d+71) then
tmp = t_1
else
tmp = x * exp((t * -y))
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 <= -0.046) {
tmp = t_1;
} else if (y <= 0.235) {
tmp = x * Math.exp((a * -b));
} else if (y <= 6e+71) {
tmp = t_1;
} else {
tmp = x * Math.exp((t * -y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.pow(z, y) tmp = 0 if y <= -0.046: tmp = t_1 elif y <= 0.235: tmp = x * math.exp((a * -b)) elif y <= 6e+71: tmp = t_1 else: tmp = x * math.exp((t * -y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) tmp = 0.0 if (y <= -0.046) tmp = t_1; elseif (y <= 0.235) tmp = Float64(x * exp(Float64(a * Float64(-b)))); elseif (y <= 6e+71) tmp = t_1; else tmp = Float64(x * exp(Float64(t * Float64(-y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (z ^ y); tmp = 0.0; if (y <= -0.046) tmp = t_1; elseif (y <= 0.235) tmp = x * exp((a * -b)); elseif (y <= 6e+71) tmp = t_1; else tmp = x * exp((t * -y)); 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, -0.046], t$95$1, If[LessEqual[y, 0.235], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e+71], t$95$1, N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -0.046:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.235:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\end{array}
\end{array}
if y < -0.045999999999999999 or 0.23499999999999999 < y < 6.00000000000000025e71Initial program 98.6%
Taylor expanded in y around inf 88.4%
Taylor expanded in t around 0 78.3%
*-commutative78.3%
Simplified78.3%
if -0.045999999999999999 < y < 0.23499999999999999Initial program 94.9%
Taylor expanded in b around inf 82.0%
mul-1-neg82.0%
distribute-rgt-neg-out82.0%
Simplified82.0%
if 6.00000000000000025e71 < y Initial program 91.2%
Taylor expanded in t around inf 74.0%
mul-1-neg74.0%
distribute-lft-neg-out74.0%
*-commutative74.0%
Simplified74.0%
Final simplification79.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))))
(if (<= y -360000000.0)
t_1
(if (<= y 0.235)
(* x (exp (* a (- (- b) z))))
(if (<= y 2.6e+71) t_1 (* x (exp (* t (- y)))))))))
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 <= -360000000.0) {
tmp = t_1;
} else if (y <= 0.235) {
tmp = x * exp((a * (-b - z)));
} else if (y <= 2.6e+71) {
tmp = t_1;
} else {
tmp = x * exp((t * -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) :: t_1
real(8) :: tmp
t_1 = x * (z ** y)
if (y <= (-360000000.0d0)) then
tmp = t_1
else if (y <= 0.235d0) then
tmp = x * exp((a * (-b - z)))
else if (y <= 2.6d+71) then
tmp = t_1
else
tmp = x * exp((t * -y))
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 <= -360000000.0) {
tmp = t_1;
} else if (y <= 0.235) {
tmp = x * Math.exp((a * (-b - z)));
} else if (y <= 2.6e+71) {
tmp = t_1;
} else {
tmp = x * Math.exp((t * -y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.pow(z, y) tmp = 0 if y <= -360000000.0: tmp = t_1 elif y <= 0.235: tmp = x * math.exp((a * (-b - z))) elif y <= 2.6e+71: tmp = t_1 else: tmp = x * math.exp((t * -y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) tmp = 0.0 if (y <= -360000000.0) tmp = t_1; elseif (y <= 0.235) tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); elseif (y <= 2.6e+71) tmp = t_1; else tmp = Float64(x * exp(Float64(t * Float64(-y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (z ^ y); tmp = 0.0; if (y <= -360000000.0) tmp = t_1; elseif (y <= 0.235) tmp = x * exp((a * (-b - z))); elseif (y <= 2.6e+71) tmp = t_1; else tmp = x * exp((t * -y)); 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, -360000000.0], t$95$1, If[LessEqual[y, 0.235], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+71], t$95$1, N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -360000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.235:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\end{array}
\end{array}
if y < -3.6e8 or 0.23499999999999999 < y < 2.59999999999999991e71Initial program 98.6%
Taylor expanded in y around inf 88.4%
Taylor expanded in t around 0 78.3%
*-commutative78.3%
Simplified78.3%
if -3.6e8 < y < 0.23499999999999999Initial program 94.9%
Taylor expanded in y around 0 82.7%
sub-neg82.7%
mul-1-neg82.7%
log1p-define87.8%
mul-1-neg87.8%
Simplified87.8%
Taylor expanded in z around 0 87.8%
+-commutative87.8%
associate-*r*87.8%
associate-*r*87.8%
distribute-lft-out87.8%
neg-mul-187.8%
Simplified87.8%
if 2.59999999999999991e71 < y Initial program 91.2%
Taylor expanded in t around inf 74.0%
mul-1-neg74.0%
distribute-lft-neg-out74.0%
*-commutative74.0%
Simplified74.0%
Final simplification82.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7300.0) (not (<= y 0.14))) (* 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 <= -7300.0) || !(y <= 0.14)) {
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 <= (-7300.0d0)) .or. (.not. (y <= 0.14d0))) 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 <= -7300.0) || !(y <= 0.14)) {
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 <= -7300.0) or not (y <= 0.14): 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 <= -7300.0) || !(y <= 0.14)) 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 <= -7300.0) || ~((y <= 0.14))) 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, -7300.0], N[Not[LessEqual[y, 0.14]], $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 -7300 \lor \neg \left(y \leq 0.14\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -7300 or 0.14000000000000001 < y Initial program 95.9%
Taylor expanded in y around inf 87.8%
Taylor expanded in t around 0 71.0%
*-commutative71.0%
Simplified71.0%
if -7300 < y < 0.14000000000000001Initial program 94.9%
Taylor expanded in b around inf 82.0%
mul-1-neg82.0%
distribute-rgt-neg-out82.0%
Simplified82.0%
Final simplification76.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7.8e-7) (not (<= y 0.09))) (* x (pow z y)) (- x (* x (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.8e-7) || !(y <= 0.09)) {
tmp = x * pow(z, y);
} else {
tmp = x - (x * (a * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-7.8d-7)) .or. (.not. (y <= 0.09d0))) then
tmp = x * (z ** y)
else
tmp = x - (x * (a * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.8e-7) || !(y <= 0.09)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x - (x * (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -7.8e-7) or not (y <= 0.09): tmp = x * math.pow(z, y) else: tmp = x - (x * (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -7.8e-7) || !(y <= 0.09)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x - Float64(x * Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -7.8e-7) || ~((y <= 0.09))) tmp = x * (z ^ y); else tmp = x - (x * (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7.8e-7], N[Not[LessEqual[y, 0.09]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{-7} \lor \neg \left(y \leq 0.09\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if y < -7.80000000000000049e-7 or 0.089999999999999997 < y Initial program 95.9%
Taylor expanded in y around inf 87.8%
Taylor expanded in t around 0 71.0%
*-commutative71.0%
Simplified71.0%
if -7.80000000000000049e-7 < y < 0.089999999999999997Initial program 94.9%
Taylor expanded in b around inf 82.0%
mul-1-neg82.0%
distribute-rgt-neg-out82.0%
Simplified82.0%
Taylor expanded in a around 0 46.3%
mul-1-neg46.3%
unsub-neg46.3%
associate-*r*49.9%
*-commutative49.9%
Simplified49.9%
Final simplification59.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.15e-21)
(* x (* a (- b)))
(if (<= y -1.75e-110)
x
(if (<= y -1.2e-149)
(* b (* x (- a)))
(if (<= y 4.2e-27) x (* a (* x (- b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.15e-21) {
tmp = x * (a * -b);
} else if (y <= -1.75e-110) {
tmp = x;
} else if (y <= -1.2e-149) {
tmp = b * (x * -a);
} else if (y <= 4.2e-27) {
tmp = x;
} else {
tmp = a * (x * -b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-2.15d-21)) then
tmp = x * (a * -b)
else if (y <= (-1.75d-110)) then
tmp = x
else if (y <= (-1.2d-149)) then
tmp = b * (x * -a)
else if (y <= 4.2d-27) then
tmp = x
else
tmp = a * (x * -b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.15e-21) {
tmp = x * (a * -b);
} else if (y <= -1.75e-110) {
tmp = x;
} else if (y <= -1.2e-149) {
tmp = b * (x * -a);
} else if (y <= 4.2e-27) {
tmp = x;
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.15e-21: tmp = x * (a * -b) elif y <= -1.75e-110: tmp = x elif y <= -1.2e-149: tmp = b * (x * -a) elif y <= 4.2e-27: tmp = x else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.15e-21) tmp = Float64(x * Float64(a * Float64(-b))); elseif (y <= -1.75e-110) tmp = x; elseif (y <= -1.2e-149) tmp = Float64(b * Float64(x * Float64(-a))); elseif (y <= 4.2e-27) tmp = x; else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.15e-21) tmp = x * (a * -b); elseif (y <= -1.75e-110) tmp = x; elseif (y <= -1.2e-149) tmp = b * (x * -a); elseif (y <= 4.2e-27) tmp = x; else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.15e-21], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.75e-110], x, If[LessEqual[y, -1.2e-149], N[(b * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e-27], x, N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{-21}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq -1.75 \cdot 10^{-110}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1.2 \cdot 10^{-149}:\\
\;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -2.1499999999999999e-21Initial program 98.3%
Taylor expanded in b around inf 36.1%
mul-1-neg36.1%
distribute-rgt-neg-out36.1%
Simplified36.1%
Taylor expanded in a around 0 9.9%
mul-1-neg9.9%
unsub-neg9.9%
associate-*r*11.4%
*-commutative11.4%
Simplified11.4%
Taylor expanded in a around inf 12.3%
neg-mul-112.3%
distribute-rgt-neg-in12.3%
Simplified12.3%
Taylor expanded in a around 0 12.3%
mul-1-neg12.3%
associate-*r*15.5%
*-commutative15.5%
distribute-rgt-neg-in15.5%
*-commutative15.5%
distribute-rgt-neg-in15.5%
Simplified15.5%
if -2.1499999999999999e-21 < y < -1.74999999999999987e-110 or -1.2000000000000001e-149 < y < 4.20000000000000031e-27Initial program 95.0%
Taylor expanded in y around inf 56.0%
Taylor expanded in y around 0 42.3%
if -1.74999999999999987e-110 < y < -1.2000000000000001e-149Initial program 100.0%
Taylor expanded in b around inf 86.4%
mul-1-neg86.4%
distribute-rgt-neg-out86.4%
Simplified86.4%
Taylor expanded in a around 0 31.8%
mul-1-neg31.8%
unsub-neg31.8%
associate-*r*31.7%
*-commutative31.7%
Simplified31.7%
Taylor expanded in a around inf 45.3%
neg-mul-145.3%
*-commutative45.3%
distribute-lft-neg-in45.3%
distribute-rgt-neg-out45.3%
associate-*l*72.0%
Simplified72.0%
if 4.20000000000000031e-27 < y Initial program 93.1%
Taylor expanded in b around inf 37.3%
mul-1-neg37.3%
distribute-rgt-neg-out37.3%
Simplified37.3%
Taylor expanded in a around 0 12.8%
mul-1-neg12.8%
unsub-neg12.8%
associate-*r*14.4%
*-commutative14.4%
Simplified14.4%
Taylor expanded in a around inf 29.8%
neg-mul-129.8%
distribute-rgt-neg-in29.8%
Simplified29.8%
Final simplification33.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -3.4e-23)
(* x (* a (- b)))
(if (<= y -1.4e-108)
(* x (+ 1.0 (* a b)))
(if (<= y -3.8e-146)
(* b (* x (- a)))
(if (<= y 4e-27) x (* a (* x (- b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.4e-23) {
tmp = x * (a * -b);
} else if (y <= -1.4e-108) {
tmp = x * (1.0 + (a * b));
} else if (y <= -3.8e-146) {
tmp = b * (x * -a);
} else if (y <= 4e-27) {
tmp = x;
} else {
tmp = a * (x * -b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-3.4d-23)) then
tmp = x * (a * -b)
else if (y <= (-1.4d-108)) then
tmp = x * (1.0d0 + (a * b))
else if (y <= (-3.8d-146)) then
tmp = b * (x * -a)
else if (y <= 4d-27) then
tmp = x
else
tmp = a * (x * -b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.4e-23) {
tmp = x * (a * -b);
} else if (y <= -1.4e-108) {
tmp = x * (1.0 + (a * b));
} else if (y <= -3.8e-146) {
tmp = b * (x * -a);
} else if (y <= 4e-27) {
tmp = x;
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.4e-23: tmp = x * (a * -b) elif y <= -1.4e-108: tmp = x * (1.0 + (a * b)) elif y <= -3.8e-146: tmp = b * (x * -a) elif y <= 4e-27: tmp = x else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.4e-23) tmp = Float64(x * Float64(a * Float64(-b))); elseif (y <= -1.4e-108) tmp = Float64(x * Float64(1.0 + Float64(a * b))); elseif (y <= -3.8e-146) tmp = Float64(b * Float64(x * Float64(-a))); elseif (y <= 4e-27) tmp = x; else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3.4e-23) tmp = x * (a * -b); elseif (y <= -1.4e-108) tmp = x * (1.0 + (a * b)); elseif (y <= -3.8e-146) tmp = b * (x * -a); elseif (y <= 4e-27) tmp = x; else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.4e-23], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.4e-108], N[(x * N[(1.0 + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.8e-146], N[(b * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e-27], x, N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-23}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-108}:\\
\;\;\;\;x \cdot \left(1 + a \cdot b\right)\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-146}:\\
\;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -3.4000000000000001e-23Initial program 98.3%
Taylor expanded in b around inf 36.1%
mul-1-neg36.1%
distribute-rgt-neg-out36.1%
Simplified36.1%
Taylor expanded in a around 0 9.9%
mul-1-neg9.9%
unsub-neg9.9%
associate-*r*11.4%
*-commutative11.4%
Simplified11.4%
Taylor expanded in a around inf 12.3%
neg-mul-112.3%
distribute-rgt-neg-in12.3%
Simplified12.3%
Taylor expanded in a around 0 12.3%
mul-1-neg12.3%
associate-*r*15.5%
*-commutative15.5%
distribute-rgt-neg-in15.5%
*-commutative15.5%
distribute-rgt-neg-in15.5%
Simplified15.5%
if -3.4000000000000001e-23 < y < -1.4e-108Initial program 100.0%
Taylor expanded in b around inf 69.4%
mul-1-neg69.4%
distribute-rgt-neg-out69.4%
Simplified69.4%
Taylor expanded in a around 0 44.2%
mul-1-neg44.2%
unsub-neg44.2%
associate-*r*44.0%
*-commutative44.0%
Simplified44.0%
*-commutative44.0%
associate-*r*44.2%
*-commutative44.2%
unsub-neg44.2%
distribute-rgt-neg-in44.2%
add-sqr-sqrt12.2%
sqrt-unprod42.9%
sqr-neg42.9%
sqrt-unprod26.6%
add-sqr-sqrt43.2%
cancel-sign-sub-inv43.2%
distribute-rgt-neg-in43.2%
distribute-lft-neg-in43.2%
cancel-sign-sub43.2%
*-commutative43.2%
associate-*r*43.1%
distribute-rgt1-in43.1%
Applied egg-rr43.1%
if -1.4e-108 < y < -3.79999999999999994e-146Initial program 100.0%
Taylor expanded in b around inf 88.1%
mul-1-neg88.1%
distribute-rgt-neg-out88.1%
Simplified88.1%
Taylor expanded in a around 0 28.2%
mul-1-neg28.2%
unsub-neg28.2%
associate-*r*28.1%
*-commutative28.1%
Simplified28.1%
Taylor expanded in a around inf 40.1%
neg-mul-140.1%
*-commutative40.1%
distribute-lft-neg-in40.1%
distribute-rgt-neg-out40.1%
associate-*l*63.3%
Simplified63.3%
if -3.79999999999999994e-146 < y < 4.0000000000000002e-27Initial program 94.0%
Taylor expanded in y around inf 53.0%
Taylor expanded in y around 0 43.4%
if 4.0000000000000002e-27 < y Initial program 93.1%
Taylor expanded in b around inf 37.3%
mul-1-neg37.3%
distribute-rgt-neg-out37.3%
Simplified37.3%
Taylor expanded in a around 0 12.8%
mul-1-neg12.8%
unsub-neg12.8%
associate-*r*14.4%
*-commutative14.4%
Simplified14.4%
Taylor expanded in a around inf 29.8%
neg-mul-129.8%
distribute-rgt-neg-in29.8%
Simplified29.8%
Final simplification33.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.1e-21)
(* x (* a (- b)))
(if (<= y -1.7e-108)
(+ x (* a (* x b)))
(if (<= y -5.2e-146)
(* b (* x (- a)))
(if (<= y 3.8e-27) x (* a (* x (- b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.1e-21) {
tmp = x * (a * -b);
} else if (y <= -1.7e-108) {
tmp = x + (a * (x * b));
} else if (y <= -5.2e-146) {
tmp = b * (x * -a);
} else if (y <= 3.8e-27) {
tmp = x;
} else {
tmp = a * (x * -b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-2.1d-21)) then
tmp = x * (a * -b)
else if (y <= (-1.7d-108)) then
tmp = x + (a * (x * b))
else if (y <= (-5.2d-146)) then
tmp = b * (x * -a)
else if (y <= 3.8d-27) then
tmp = x
else
tmp = a * (x * -b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.1e-21) {
tmp = x * (a * -b);
} else if (y <= -1.7e-108) {
tmp = x + (a * (x * b));
} else if (y <= -5.2e-146) {
tmp = b * (x * -a);
} else if (y <= 3.8e-27) {
tmp = x;
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.1e-21: tmp = x * (a * -b) elif y <= -1.7e-108: tmp = x + (a * (x * b)) elif y <= -5.2e-146: tmp = b * (x * -a) elif y <= 3.8e-27: tmp = x else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.1e-21) tmp = Float64(x * Float64(a * Float64(-b))); elseif (y <= -1.7e-108) tmp = Float64(x + Float64(a * Float64(x * b))); elseif (y <= -5.2e-146) tmp = Float64(b * Float64(x * Float64(-a))); elseif (y <= 3.8e-27) tmp = x; else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.1e-21) tmp = x * (a * -b); elseif (y <= -1.7e-108) tmp = x + (a * (x * b)); elseif (y <= -5.2e-146) tmp = b * (x * -a); elseif (y <= 3.8e-27) tmp = x; else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.1e-21], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.7e-108], N[(x + N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.2e-146], N[(b * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e-27], x, N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-21}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq -1.7 \cdot 10^{-108}:\\
\;\;\;\;x + a \cdot \left(x \cdot b\right)\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{-146}:\\
\;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -2.10000000000000013e-21Initial program 98.3%
Taylor expanded in b around inf 36.1%
mul-1-neg36.1%
distribute-rgt-neg-out36.1%
Simplified36.1%
Taylor expanded in a around 0 9.9%
mul-1-neg9.9%
unsub-neg9.9%
associate-*r*11.4%
*-commutative11.4%
Simplified11.4%
Taylor expanded in a around inf 12.3%
neg-mul-112.3%
distribute-rgt-neg-in12.3%
Simplified12.3%
Taylor expanded in a around 0 12.3%
mul-1-neg12.3%
associate-*r*15.5%
*-commutative15.5%
distribute-rgt-neg-in15.5%
*-commutative15.5%
distribute-rgt-neg-in15.5%
Simplified15.5%
if -2.10000000000000013e-21 < y < -1.70000000000000001e-108Initial program 100.0%
Taylor expanded in b around inf 69.4%
mul-1-neg69.4%
distribute-rgt-neg-out69.4%
Simplified69.4%
Taylor expanded in a around 0 44.2%
mul-1-neg44.2%
unsub-neg44.2%
associate-*r*44.0%
*-commutative44.0%
Simplified44.0%
*-commutative44.0%
associate-*r*44.2%
*-commutative44.2%
unsub-neg44.2%
distribute-rgt-neg-in44.2%
add-sqr-sqrt12.2%
sqrt-unprod42.9%
sqr-neg42.9%
sqrt-unprod26.6%
add-sqr-sqrt43.2%
cancel-sign-sub-inv43.2%
distribute-rgt-neg-in43.2%
distribute-lft-neg-in43.2%
cancel-sign-sub43.2%
+-commutative43.2%
*-commutative43.2%
Applied egg-rr43.2%
if -1.70000000000000001e-108 < y < -5.19999999999999974e-146Initial program 100.0%
Taylor expanded in b around inf 88.1%
mul-1-neg88.1%
distribute-rgt-neg-out88.1%
Simplified88.1%
Taylor expanded in a around 0 28.2%
mul-1-neg28.2%
unsub-neg28.2%
associate-*r*28.1%
*-commutative28.1%
Simplified28.1%
Taylor expanded in a around inf 40.1%
neg-mul-140.1%
*-commutative40.1%
distribute-lft-neg-in40.1%
distribute-rgt-neg-out40.1%
associate-*l*63.3%
Simplified63.3%
if -5.19999999999999974e-146 < y < 3.8e-27Initial program 94.0%
Taylor expanded in y around inf 53.0%
Taylor expanded in y around 0 43.4%
if 3.8e-27 < y Initial program 93.1%
Taylor expanded in b around inf 37.3%
mul-1-neg37.3%
distribute-rgt-neg-out37.3%
Simplified37.3%
Taylor expanded in a around 0 12.8%
mul-1-neg12.8%
unsub-neg12.8%
associate-*r*14.4%
*-commutative14.4%
Simplified14.4%
Taylor expanded in a around inf 29.8%
neg-mul-129.8%
distribute-rgt-neg-in29.8%
Simplified29.8%
Final simplification33.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.05e-23) (not (<= y 4.4e-27))) (* a (* x (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.05e-23) || !(y <= 4.4e-27)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.05d-23)) .or. (.not. (y <= 4.4d-27))) then
tmp = a * (x * -b)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.05e-23) || !(y <= 4.4e-27)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.05e-23) or not (y <= 4.4e-27): tmp = a * (x * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.05e-23) || !(y <= 4.4e-27)) tmp = Float64(a * Float64(x * Float64(-b))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.05e-23) || ~((y <= 4.4e-27))) tmp = a * (x * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.05e-23], N[Not[LessEqual[y, 4.4e-27]], $MachinePrecision]], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{-23} \lor \neg \left(y \leq 4.4 \cdot 10^{-27}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.05000000000000015e-23 or 4.39999999999999974e-27 < y Initial program 95.4%
Taylor expanded in b around inf 36.7%
mul-1-neg36.7%
distribute-rgt-neg-out36.7%
Simplified36.7%
Taylor expanded in a around 0 11.5%
mul-1-neg11.5%
unsub-neg11.5%
associate-*r*13.0%
*-commutative13.0%
Simplified13.0%
Taylor expanded in a around inf 21.9%
neg-mul-121.9%
distribute-rgt-neg-in21.9%
Simplified21.9%
if -2.05000000000000015e-23 < y < 4.39999999999999974e-27Initial program 95.3%
Taylor expanded in y around inf 53.9%
Taylor expanded in y around 0 40.3%
Final simplification30.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y 0.8) (- x (* x (* a b))) (* a (* x (- b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 0.8) {
tmp = x - (x * (a * b));
} else {
tmp = a * (x * -b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 0.8d0) then
tmp = x - (x * (a * b))
else
tmp = a * (x * -b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 0.8) {
tmp = x - (x * (a * b));
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 0.8: tmp = x - (x * (a * b)) else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 0.8) tmp = Float64(x - Float64(x * Float64(a * b))); else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 0.8) tmp = x - (x * (a * b)); else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 0.8], N[(x - N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.8:\\
\;\;\;\;x - x \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < 0.80000000000000004Initial program 95.9%
Taylor expanded in b around inf 67.8%
mul-1-neg67.8%
distribute-rgt-neg-out67.8%
Simplified67.8%
Taylor expanded in a around 0 35.4%
mul-1-neg35.4%
unsub-neg35.4%
associate-*r*37.8%
*-commutative37.8%
Simplified37.8%
if 0.80000000000000004 < y Initial program 93.8%
Taylor expanded in b around inf 33.9%
mul-1-neg33.9%
distribute-rgt-neg-out33.9%
Simplified33.9%
Taylor expanded in a around 0 10.8%
mul-1-neg10.8%
unsub-neg10.8%
associate-*r*11.1%
*-commutative11.1%
Simplified11.1%
Taylor expanded in a around inf 28.5%
neg-mul-128.5%
distribute-rgt-neg-in28.5%
Simplified28.5%
Final simplification35.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.12e-13) x (* a (* x b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.12e-13) {
tmp = x;
} else {
tmp = a * (x * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 1.12d-13) then
tmp = x
else
tmp = a * (x * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.12e-13) {
tmp = x;
} else {
tmp = a * (x * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.12e-13: tmp = x else: tmp = a * (x * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.12e-13) tmp = x; else tmp = Float64(a * Float64(x * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.12e-13) tmp = x; else tmp = a * (x * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.12e-13], x, N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.12 \cdot 10^{-13}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if y < 1.12e-13Initial program 96.3%
Taylor expanded in y around inf 63.7%
Taylor expanded in y around 0 28.2%
if 1.12e-13 < y Initial program 92.9%
Taylor expanded in b around inf 35.5%
mul-1-neg35.5%
distribute-rgt-neg-out35.5%
Simplified35.5%
Taylor expanded in a around 0 11.7%
mul-1-neg11.7%
unsub-neg11.7%
associate-*r*13.3%
*-commutative13.3%
Simplified13.3%
*-commutative13.3%
associate-*r*11.7%
*-commutative11.7%
unsub-neg11.7%
distribute-rgt-neg-in11.7%
add-sqr-sqrt5.8%
sqrt-unprod9.6%
sqr-neg9.6%
sqrt-unprod4.4%
add-sqr-sqrt7.2%
cancel-sign-sub-inv7.2%
distribute-rgt-neg-in7.2%
distribute-lft-neg-in7.2%
cancel-sign-sub7.2%
*-commutative7.2%
associate-*r*6.0%
distribute-rgt1-in6.0%
Applied egg-rr6.0%
Taylor expanded in a around inf 24.7%
*-commutative24.7%
Simplified24.7%
Final simplification27.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 95.4%
Taylor expanded in y around inf 69.4%
Taylor expanded in y around 0 21.7%
Final simplification21.7%
herbie shell --seed 2024067
(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))))))