
(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.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.15e+36) (not (<= z 1.65e+140))) (- (- (log t) z) y) (- (+ (* x (log y)) (log t)) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.15e+36) || !(z <= 1.65e+140)) {
tmp = (log(t) - z) - y;
} else {
tmp = ((x * log(y)) + log(t)) - 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 <= (-2.15d+36)) .or. (.not. (z <= 1.65d+140))) then
tmp = (log(t) - z) - y
else
tmp = ((x * log(y)) + log(t)) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.15e+36) || !(z <= 1.65e+140)) {
tmp = (Math.log(t) - z) - y;
} else {
tmp = ((x * Math.log(y)) + Math.log(t)) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.15e+36) or not (z <= 1.65e+140): tmp = (math.log(t) - z) - y else: tmp = ((x * math.log(y)) + math.log(t)) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.15e+36) || !(z <= 1.65e+140)) tmp = Float64(Float64(log(t) - z) - y); else tmp = Float64(Float64(Float64(x * log(y)) + log(t)) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.15e+36) || ~((z <= 1.65e+140))) tmp = (log(t) - z) - y; else tmp = ((x * log(y)) + log(t)) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.15e+36], N[Not[LessEqual[z, 1.65e+140]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+36} \lor \neg \left(z \leq 1.65 \cdot 10^{+140}\right):\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \log y + \log t\right) - y\\
\end{array}
\end{array}
if z < -2.15000000000000002e36 or 1.6500000000000001e140 < z Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
+-commutative100.0%
associate--r+100.0%
fma-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 84.2%
if -2.15000000000000002e36 < z < 1.6500000000000001e140Initial program 99.8%
Taylor expanded in z around 0 93.8%
Final simplification90.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.5e-12) (not (<= x 8e+71))) (- (+ (* x (log y)) (log t)) z) (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.5e-12) || !(x <= 8e+71)) {
tmp = ((x * log(y)) + log(t)) - z;
} else {
tmp = (log(t) - z) - 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 ((x <= (-3.5d-12)) .or. (.not. (x <= 8d+71))) then
tmp = ((x * log(y)) + log(t)) - z
else
tmp = (log(t) - z) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.5e-12) || !(x <= 8e+71)) {
tmp = ((x * Math.log(y)) + Math.log(t)) - z;
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.5e-12) or not (x <= 8e+71): tmp = ((x * math.log(y)) + math.log(t)) - z else: tmp = (math.log(t) - z) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.5e-12) || !(x <= 8e+71)) tmp = Float64(Float64(Float64(x * log(y)) + log(t)) - z); else tmp = Float64(Float64(log(t) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.5e-12) || ~((x <= 8e+71))) tmp = ((x * log(y)) + log(t)) - z; else tmp = (log(t) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.5e-12], N[Not[LessEqual[x, 8e+71]], $MachinePrecision]], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{-12} \lor \neg \left(x \leq 8 \cdot 10^{+71}\right):\\
\;\;\;\;\left(x \cdot \log y + \log t\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if x < -3.5e-12 or 8.0000000000000003e71 < x Initial program 99.7%
Taylor expanded in y around 0 89.9%
if -3.5e-12 < x < 8.0000000000000003e71Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
+-commutative100.0%
associate--r+100.0%
fma-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 97.4%
Final simplification94.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (log t) y)))
(if (<= x -24.5)
t_1
(if (<= x 1.4e-295)
t_2
(if (<= x 6.8e-226) (- (log t) z) (if (<= x 2.2e+66) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = log(t) - y;
double tmp;
if (x <= -24.5) {
tmp = t_1;
} else if (x <= 1.4e-295) {
tmp = t_2;
} else if (x <= 6.8e-226) {
tmp = log(t) - z;
} else if (x <= 2.2e+66) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = log(t) - y
if (x <= (-24.5d0)) then
tmp = t_1
else if (x <= 1.4d-295) then
tmp = t_2
else if (x <= 6.8d-226) then
tmp = log(t) - z
else if (x <= 2.2d+66) then
tmp = t_2
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 = x * Math.log(y);
double t_2 = Math.log(t) - y;
double tmp;
if (x <= -24.5) {
tmp = t_1;
} else if (x <= 1.4e-295) {
tmp = t_2;
} else if (x <= 6.8e-226) {
tmp = Math.log(t) - z;
} else if (x <= 2.2e+66) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = math.log(t) - y tmp = 0 if x <= -24.5: tmp = t_1 elif x <= 1.4e-295: tmp = t_2 elif x <= 6.8e-226: tmp = math.log(t) - z elif x <= 2.2e+66: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(log(t) - y) tmp = 0.0 if (x <= -24.5) tmp = t_1; elseif (x <= 1.4e-295) tmp = t_2; elseif (x <= 6.8e-226) tmp = Float64(log(t) - z); elseif (x <= 2.2e+66) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = log(t) - y; tmp = 0.0; if (x <= -24.5) tmp = t_1; elseif (x <= 1.4e-295) tmp = t_2; elseif (x <= 6.8e-226) tmp = log(t) - z; elseif (x <= 2.2e+66) tmp = t_2; else tmp = t_1; 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[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[x, -24.5], t$95$1, If[LessEqual[x, 1.4e-295], t$95$2, If[LessEqual[x, 6.8e-226], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], If[LessEqual[x, 2.2e+66], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \log t - y\\
\mathbf{if}\;x \leq -24.5:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-295}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-226}:\\
\;\;\;\;\log t - z\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+66}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -24.5 or 2.1999999999999998e66 < x Initial program 99.7%
Taylor expanded in x around inf 65.6%
if -24.5 < x < 1.4e-295 or 6.80000000000000014e-226 < x < 2.1999999999999998e66Initial program 100.0%
Taylor expanded in z around 0 74.4%
log-pow65.8%
log-prod65.8%
Simplified65.8%
Taylor expanded in x around 0 71.3%
if 1.4e-295 < x < 6.80000000000000014e-226Initial program 100.0%
flip--83.0%
clear-num83.0%
fma-def83.0%
pow283.0%
Applied egg-rr83.0%
Taylor expanded in x around inf 82.7%
associate-/r*82.7%
Simplified82.7%
Taylor expanded in x around 0 82.7%
Final simplification69.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.8e+58) (not (<= x 2.1e+82))) (* x (log y)) (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.8e+58) || !(x <= 2.1e+82)) {
tmp = x * log(y);
} else {
tmp = (log(t) - z) - 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 ((x <= (-3.8d+58)) .or. (.not. (x <= 2.1d+82))) then
tmp = x * log(y)
else
tmp = (log(t) - z) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.8e+58) || !(x <= 2.1e+82)) {
tmp = x * Math.log(y);
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.8e+58) or not (x <= 2.1e+82): tmp = x * math.log(y) else: tmp = (math.log(t) - z) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.8e+58) || !(x <= 2.1e+82)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(log(t) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.8e+58) || ~((x <= 2.1e+82))) tmp = x * log(y); else tmp = (log(t) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.8e+58], N[Not[LessEqual[x, 2.1e+82]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{+58} \lor \neg \left(x \leq 2.1 \cdot 10^{+82}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if x < -3.7999999999999999e58 or 2.1e82 < x Initial program 99.7%
Taylor expanded in x around inf 71.9%
if -3.7999999999999999e58 < x < 2.1e82Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
+-commutative100.0%
associate--r+100.0%
fma-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 94.3%
Final simplification86.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -24.5) (not (<= x 3.4e+67))) (* x (log y)) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -24.5) || !(x <= 3.4e+67)) {
tmp = x * log(y);
} 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 ((x <= (-24.5d0)) .or. (.not. (x <= 3.4d+67))) then
tmp = x * log(y)
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -24.5) || !(x <= 3.4e+67)) {
tmp = x * Math.log(y);
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -24.5) or not (x <= 3.4e+67): tmp = x * math.log(y) else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -24.5) || !(x <= 3.4e+67)) tmp = Float64(x * log(y)); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -24.5) || ~((x <= 3.4e+67))) tmp = x * log(y); else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -24.5], N[Not[LessEqual[x, 3.4e+67]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -24.5 \lor \neg \left(x \leq 3.4 \cdot 10^{+67}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if x < -24.5 or 3.4000000000000002e67 < x Initial program 99.7%
Taylor expanded in x around inf 65.6%
if -24.5 < x < 3.4000000000000002e67Initial program 100.0%
Taylor expanded in y around inf 48.4%
neg-mul-148.4%
Simplified48.4%
Final simplification55.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -24.5) (not (<= x 1.55e+66))) (* x (log y)) (- (log t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -24.5) || !(x <= 1.55e+66)) {
tmp = x * log(y);
} else {
tmp = log(t) - 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 ((x <= (-24.5d0)) .or. (.not. (x <= 1.55d+66))) then
tmp = x * log(y)
else
tmp = log(t) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -24.5) || !(x <= 1.55e+66)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -24.5) or not (x <= 1.55e+66): tmp = x * math.log(y) else: tmp = math.log(t) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -24.5) || !(x <= 1.55e+66)) tmp = Float64(x * log(y)); else tmp = Float64(log(t) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -24.5) || ~((x <= 1.55e+66))) tmp = x * log(y); else tmp = log(t) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -24.5], N[Not[LessEqual[x, 1.55e+66]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -24.5 \lor \neg \left(x \leq 1.55 \cdot 10^{+66}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - y\\
\end{array}
\end{array}
if x < -24.5 or 1.55000000000000009e66 < x Initial program 99.7%
Taylor expanded in x around inf 65.6%
if -24.5 < x < 1.55000000000000009e66Initial program 100.0%
Taylor expanded in z around 0 72.3%
log-pow64.4%
log-prod64.4%
Simplified64.4%
Taylor expanded in x around 0 69.4%
Final simplification67.8%
(FPCore (x y z t) :precision binary64 (if (<= y 9.5e-246) (- z) (if (<= y 2.1e-191) (log t) (if (<= y 2e+25) (- z) (- y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9.5e-246) {
tmp = -z;
} else if (y <= 2.1e-191) {
tmp = log(t);
} else if (y <= 2e+25) {
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 <= 9.5d-246) then
tmp = -z
else if (y <= 2.1d-191) then
tmp = log(t)
else if (y <= 2d+25) 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 <= 9.5e-246) {
tmp = -z;
} else if (y <= 2.1e-191) {
tmp = Math.log(t);
} else if (y <= 2e+25) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 9.5e-246: tmp = -z elif y <= 2.1e-191: tmp = math.log(t) elif y <= 2e+25: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 9.5e-246) tmp = Float64(-z); elseif (y <= 2.1e-191) tmp = log(t); elseif (y <= 2e+25) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 9.5e-246) tmp = -z; elseif (y <= 2.1e-191) tmp = log(t); elseif (y <= 2e+25) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 9.5e-246], (-z), If[LessEqual[y, 2.1e-191], N[Log[t], $MachinePrecision], If[LessEqual[y, 2e+25], (-z), (-y)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.5 \cdot 10^{-246}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-191}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+25}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 9.5000000000000002e-246 or 2.09999999999999985e-191 < y < 2.00000000000000018e25Initial program 99.8%
Taylor expanded in z around inf 35.7%
neg-mul-135.7%
Simplified35.7%
if 9.5000000000000002e-246 < y < 2.09999999999999985e-191Initial program 99.9%
flip--92.3%
clear-num92.3%
fma-def92.3%
pow292.3%
Applied egg-rr92.3%
Taylor expanded in x around inf 99.8%
Taylor expanded in z around 0 72.5%
*-commutative72.5%
Simplified72.5%
Taylor expanded in x around 0 49.3%
if 2.00000000000000018e25 < y Initial program 99.9%
Taylor expanded in y around inf 66.5%
neg-mul-166.5%
Simplified66.5%
Final simplification51.4%
(FPCore (x y z t) :precision binary64 (if (<= y 1.65e+25) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.65e+25) {
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 <= 1.65d+25) 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 <= 1.65e+25) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.65e+25: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.65e+25) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.65e+25) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.65e+25], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.65 \cdot 10^{+25}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1.6500000000000001e25Initial program 99.8%
Taylor expanded in z around inf 34.5%
neg-mul-134.5%
Simplified34.5%
if 1.6500000000000001e25 < y Initial program 99.9%
Taylor expanded in y around inf 66.5%
neg-mul-166.5%
Simplified66.5%
Final simplification49.4%
(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.9%
Taylor expanded in y around inf 32.8%
neg-mul-132.8%
Simplified32.8%
Final simplification32.8%
herbie shell --seed 2023271
(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)))