
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -2e+238)
t_2
(if (<= t_2 -5e-9) (- (log t) (+ y z)) (- (+ t_1 (log t)) z)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -2e+238) {
tmp = t_2;
} else if (t_2 <= -5e-9) {
tmp = log(t) - (y + z);
} else {
tmp = (t_1 + log(t)) - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (t_2 <= (-2d+238)) then
tmp = t_2
else if (t_2 <= (-5d-9)) then
tmp = log(t) - (y + z)
else
tmp = (t_1 + log(t)) - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -2e+238) {
tmp = t_2;
} else if (t_2 <= -5e-9) {
tmp = Math.log(t) - (y + z);
} else {
tmp = (t_1 + Math.log(t)) - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if t_2 <= -2e+238: tmp = t_2 elif t_2 <= -5e-9: tmp = math.log(t) - (y + z) else: tmp = (t_1 + math.log(t)) - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if (t_2 <= -2e+238) tmp = t_2; elseif (t_2 <= -5e-9) tmp = Float64(log(t) - Float64(y + z)); else tmp = Float64(Float64(t_1 + log(t)) - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; tmp = 0.0; if (t_2 <= -2e+238) tmp = t_2; elseif (t_2 <= -5e-9) tmp = log(t) - (y + z); else tmp = (t_1 + log(t)) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+238], t$95$2, If[LessEqual[t$95$2, -5e-9], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[Log[t], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+238}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-9}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 + \log t\right) - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -2.0000000000000001e238Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 95.2%
if -2.0000000000000001e238 < (-.f64 (*.f64 x (log.f64 y)) y) < -5.0000000000000001e-9Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around 0 82.5%
if -5.0000000000000001e-9 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around 0 98.1%
Final simplification91.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -2e+238)
t_2
(if (<= t_2 2e-26) (- (log t) (+ y z)) (- t_1 z)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -2e+238) {
tmp = t_2;
} else if (t_2 <= 2e-26) {
tmp = log(t) - (y + z);
} else {
tmp = t_1 - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (t_2 <= (-2d+238)) then
tmp = t_2
else if (t_2 <= 2d-26) then
tmp = log(t) - (y + z)
else
tmp = t_1 - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -2e+238) {
tmp = t_2;
} else if (t_2 <= 2e-26) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if t_2 <= -2e+238: tmp = t_2 elif t_2 <= 2e-26: tmp = math.log(t) - (y + z) else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if (t_2 <= -2e+238) tmp = t_2; elseif (t_2 <= 2e-26) tmp = Float64(log(t) - Float64(y + z)); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; tmp = 0.0; if (t_2 <= -2e+238) tmp = t_2; elseif (t_2 <= 2e-26) tmp = log(t) - (y + z); else tmp = t_1 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+238], t$95$2, If[LessEqual[t$95$2, 2e-26], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+238}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-26}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -2.0000000000000001e238Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 95.2%
if -2.0000000000000001e238 < (-.f64 (*.f64 x (log.f64 y)) y) < 2.0000000000000001e-26Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around 0 88.8%
if 2.0000000000000001e-26 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.5%
associate-+l-99.5%
associate--l-99.5%
Simplified99.5%
Taylor expanded in z around inf 95.5%
Final simplification91.4%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -1.12e+234)
(and (not (<= x 4.1e+116))
(or (<= x 5.5e+173) (not (<= x 2.7e+216)))))
(* x (log y))
(- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.12e+234) || (!(x <= 4.1e+116) && ((x <= 5.5e+173) || !(x <= 2.7e+216)))) {
tmp = x * log(y);
} else {
tmp = log(t) - (y + z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-1.12d+234)) .or. (.not. (x <= 4.1d+116)) .and. (x <= 5.5d+173) .or. (.not. (x <= 2.7d+216))) then
tmp = x * log(y)
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.12e+234) || (!(x <= 4.1e+116) && ((x <= 5.5e+173) || !(x <= 2.7e+216)))) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.12e+234) or (not (x <= 4.1e+116) and ((x <= 5.5e+173) or not (x <= 2.7e+216))): tmp = x * math.log(y) else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.12e+234) || (!(x <= 4.1e+116) && ((x <= 5.5e+173) || !(x <= 2.7e+216)))) tmp = Float64(x * log(y)); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.12e+234) || (~((x <= 4.1e+116)) && ((x <= 5.5e+173) || ~((x <= 2.7e+216))))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.12e+234], And[N[Not[LessEqual[x, 4.1e+116]], $MachinePrecision], Or[LessEqual[x, 5.5e+173], N[Not[LessEqual[x, 2.7e+216]], $MachinePrecision]]]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.12 \cdot 10^{+234} \lor \neg \left(x \leq 4.1 \cdot 10^{+116}\right) \land \left(x \leq 5.5 \cdot 10^{+173} \lor \neg \left(x \leq 2.7 \cdot 10^{+216}\right)\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.12000000000000004e234 or 4.0999999999999998e116 < x < 5.50000000000000049e173 or 2.7000000000000001e216 < x Initial program 99.5%
associate-+l-99.5%
associate--l-99.5%
Simplified99.5%
*-commutative99.5%
add-cube-cbrt98.4%
associate-*r*98.5%
fma-neg98.4%
pow298.4%
associate-+r-98.4%
Applied egg-rr98.4%
Taylor expanded in x around inf 80.1%
if -1.12000000000000004e234 < x < 4.0999999999999998e116 or 5.50000000000000049e173 < x < 2.7000000000000001e216Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around 0 87.0%
Final simplification85.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- -1.0 (/ y z)))))
(if (<= z -1.15e-43)
t_1
(if (<= z -1.6e-201) (- y) (if (<= z 0.00031) (* x (log y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = z * (-1.0 - (y / z));
double tmp;
if (z <= -1.15e-43) {
tmp = t_1;
} else if (z <= -1.6e-201) {
tmp = -y;
} else if (z <= 0.00031) {
tmp = x * log(y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = z * ((-1.0d0) - (y / z))
if (z <= (-1.15d-43)) then
tmp = t_1
else if (z <= (-1.6d-201)) then
tmp = -y
else if (z <= 0.00031d0) then
tmp = x * log(y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (-1.0 - (y / z));
double tmp;
if (z <= -1.15e-43) {
tmp = t_1;
} else if (z <= -1.6e-201) {
tmp = -y;
} else if (z <= 0.00031) {
tmp = x * Math.log(y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (-1.0 - (y / z)) tmp = 0 if z <= -1.15e-43: tmp = t_1 elif z <= -1.6e-201: tmp = -y elif z <= 0.00031: tmp = x * math.log(y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-1.0 - Float64(y / z))) tmp = 0.0 if (z <= -1.15e-43) tmp = t_1; elseif (z <= -1.6e-201) tmp = Float64(-y); elseif (z <= 0.00031) tmp = Float64(x * log(y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (-1.0 - (y / z)); tmp = 0.0; if (z <= -1.15e-43) tmp = t_1; elseif (z <= -1.6e-201) tmp = -y; elseif (z <= 0.00031) tmp = x * log(y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(-1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e-43], t$95$1, If[LessEqual[z, -1.6e-201], (-y), If[LessEqual[z, 0.00031], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-201}:\\
\;\;\;\;-y\\
\mathbf{elif}\;z \leq 0.00031:\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.1499999999999999e-43 or 3.1e-4 < z Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
*-commutative99.9%
add-cube-cbrt99.6%
associate-*r*99.6%
fma-neg99.6%
pow299.6%
associate-+r-99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 99.8%
+-commutative99.8%
associate--r+99.8%
+-commutative99.8%
associate--l+99.8%
associate-/l*99.8%
div-sub99.8%
Simplified99.8%
Taylor expanded in y around inf 80.1%
associate-*r/80.1%
neg-mul-180.1%
Simplified80.1%
if -1.1499999999999999e-43 < z < -1.6000000000000001e-201Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 51.4%
mul-1-neg51.4%
Simplified51.4%
if -1.6000000000000001e-201 < z < 3.1e-4Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
*-commutative99.7%
add-cube-cbrt99.1%
associate-*r*99.1%
fma-neg99.1%
pow299.1%
associate-+r-99.1%
Applied egg-rr99.1%
Taylor expanded in x around inf 46.6%
Final simplification67.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.15e+61) (not (<= x 2.55e+54))) (- (* x (log y)) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.15e+61) || !(x <= 2.55e+54)) {
tmp = (x * log(y)) - y;
} else {
tmp = log(t) - (y + z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-2.15d+61)) .or. (.not. (x <= 2.55d+54))) then
tmp = (x * log(y)) - y
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.15e+61) || !(x <= 2.55e+54)) {
tmp = (x * Math.log(y)) - y;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.15e+61) or not (x <= 2.55e+54): tmp = (x * math.log(y)) - y else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.15e+61) || !(x <= 2.55e+54)) tmp = Float64(Float64(x * log(y)) - y); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.15e+61) || ~((x <= 2.55e+54))) tmp = (x * log(y)) - y; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.15e+61], N[Not[LessEqual[x, 2.55e+54]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.15 \cdot 10^{+61} \lor \neg \left(x \leq 2.55 \cdot 10^{+54}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -2.1500000000000001e61 or 2.55000000000000005e54 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in y around inf 78.8%
if -2.1500000000000001e61 < x < 2.55000000000000005e54Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around 0 96.7%
Final simplification88.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6.2e-42) (not (<= z 2.7e-100))) (* z (- -1.0 (/ y z))) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.2e-42) || !(z <= 2.7e-100)) {
tmp = z * (-1.0 - (y / z));
} else {
tmp = -y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-6.2d-42)) .or. (.not. (z <= 2.7d-100))) then
tmp = z * ((-1.0d0) - (y / z))
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.2e-42) || !(z <= 2.7e-100)) {
tmp = z * (-1.0 - (y / z));
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6.2e-42) or not (z <= 2.7e-100): tmp = z * (-1.0 - (y / z)) else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6.2e-42) || !(z <= 2.7e-100)) tmp = Float64(z * Float64(-1.0 - Float64(y / z))); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -6.2e-42) || ~((z <= 2.7e-100))) tmp = z * (-1.0 - (y / z)); else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6.2e-42], N[Not[LessEqual[z, 2.7e-100]], $MachinePrecision]], N[(z * N[(-1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-42} \lor \neg \left(z \leq 2.7 \cdot 10^{-100}\right):\\
\;\;\;\;z \cdot \left(-1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if z < -6.2000000000000005e-42 or 2.70000000000000016e-100 < z Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
*-commutative99.9%
add-cube-cbrt99.6%
associate-*r*99.6%
fma-neg99.5%
pow299.5%
associate-+r-99.5%
Applied egg-rr99.5%
Taylor expanded in z around inf 98.7%
+-commutative98.7%
associate--r+98.7%
+-commutative98.7%
associate--l+98.7%
associate-/l*98.7%
div-sub98.7%
Simplified98.7%
Taylor expanded in y around inf 76.1%
associate-*r/76.1%
neg-mul-176.1%
Simplified76.1%
if -6.2000000000000005e-42 < z < 2.70000000000000016e-100Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 37.4%
mul-1-neg37.4%
Simplified37.4%
Final simplification63.4%
(FPCore (x y z t) :precision binary64 (if (<= y 4.2e+14) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.2e+14) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 4.2d+14) then
tmp = -z
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.2e+14) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 4.2e+14: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 4.2e+14) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 4.2e+14) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 4.2e+14], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.2 \cdot 10^{+14}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 4.2e14Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 48.0%
mul-1-neg48.0%
Simplified48.0%
if 4.2e14 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 60.7%
mul-1-neg60.7%
Simplified60.7%
Final simplification54.2%
(FPCore (x y z t) :precision binary64 (- y))
double code(double x, double y, double z, double t) {
return -y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -y
end function
public static double code(double x, double y, double z, double t) {
return -y;
}
def code(x, y, z, t): return -y
function code(x, y, z, t) return Float64(-y) end
function tmp = code(x, y, z, t) tmp = -y; end
code[x_, y_, z_, t_] := (-y)
\begin{array}{l}
\\
-y
\end{array}
Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 30.8%
mul-1-neg30.8%
Simplified30.8%
Final simplification30.8%
(FPCore (x y z t) :precision binary64 z)
double code(double x, double y, double z, double t) {
return z;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = z
end function
public static double code(double x, double y, double z, double t) {
return z;
}
def code(x, y, z, t): return z
function code(x, y, z, t) return z end
function tmp = code(x, y, z, t) tmp = z; end
code[x_, y_, z_, t_] := z
\begin{array}{l}
\\
z
\end{array}
Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 60.0%
sub-neg60.0%
add-sqr-sqrt28.3%
sqrt-unprod30.2%
sqr-neg30.2%
sqrt-unprod14.1%
add-sqr-sqrt27.0%
expm1-log1p-u14.3%
fma-define14.3%
Applied egg-rr14.3%
Taylor expanded in x around 0 2.2%
Final simplification2.2%
herbie shell --seed 2024071
(FPCore (x y z t)
:name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A"
:precision binary64
(+ (- (- (* x (log y)) y) z) (log t)))