
(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 9 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%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x)) (t_2 (- (* x (log y)) y)))
(if (<= t_2 -2e+228)
(- y)
(if (<= t_2 -1e+179)
t_1
(if (<= t_2 -4e+45)
(- (log t) y)
(if (<= t_2 5e-10) (- (log t) z) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double t_2 = (x * log(y)) - y;
double tmp;
if (t_2 <= -2e+228) {
tmp = -y;
} else if (t_2 <= -1e+179) {
tmp = t_1;
} else if (t_2 <= -4e+45) {
tmp = log(t) - y;
} else if (t_2 <= 5e-10) {
tmp = log(t) - z;
} 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 = log(y) * x
t_2 = (x * log(y)) - y
if (t_2 <= (-2d+228)) then
tmp = -y
else if (t_2 <= (-1d+179)) then
tmp = t_1
else if (t_2 <= (-4d+45)) then
tmp = log(t) - y
else if (t_2 <= 5d-10) then
tmp = log(t) - z
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 = Math.log(y) * x;
double t_2 = (x * Math.log(y)) - y;
double tmp;
if (t_2 <= -2e+228) {
tmp = -y;
} else if (t_2 <= -1e+179) {
tmp = t_1;
} else if (t_2 <= -4e+45) {
tmp = Math.log(t) - y;
} else if (t_2 <= 5e-10) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x t_2 = (x * math.log(y)) - y tmp = 0 if t_2 <= -2e+228: tmp = -y elif t_2 <= -1e+179: tmp = t_1 elif t_2 <= -4e+45: tmp = math.log(t) - y elif t_2 <= 5e-10: tmp = math.log(t) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) t_2 = Float64(Float64(x * log(y)) - y) tmp = 0.0 if (t_2 <= -2e+228) tmp = Float64(-y); elseif (t_2 <= -1e+179) tmp = t_1; elseif (t_2 <= -4e+45) tmp = Float64(log(t) - y); elseif (t_2 <= 5e-10) tmp = Float64(log(t) - z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * x; t_2 = (x * log(y)) - y; tmp = 0.0; if (t_2 <= -2e+228) tmp = -y; elseif (t_2 <= -1e+179) tmp = t_1; elseif (t_2 <= -4e+45) tmp = log(t) - y; elseif (t_2 <= 5e-10) tmp = log(t) - z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+228], (-y), If[LessEqual[t$95$2, -1e+179], t$95$1, If[LessEqual[t$95$2, -4e+45], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[t$95$2, 5e-10], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := x \cdot \log y - y\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+228}:\\
\;\;\;\;-y\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+179}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{+45}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-10}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -1.9999999999999998e228Initial program 99.9%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.7%
Applied rewrites99.7%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6463.9
Applied rewrites63.9%
if -1.9999999999999998e228 < (-.f64 (*.f64 x (log.f64 y)) y) < -9.9999999999999998e178 or 5.00000000000000031e-10 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.5%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6469.6
Applied rewrites69.6%
if -9.9999999999999998e178 < (-.f64 (*.f64 x (log.f64 y)) y) < -3.9999999999999997e45Initial program 100.0%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6463.0
Applied rewrites63.0%
Taylor expanded in x around 0
Applied rewrites56.9%
if -3.9999999999999997e45 < (-.f64 (*.f64 x (log.f64 y)) y) < 5.00000000000000031e-10Initial program 100.0%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.8%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6498.0
Applied rewrites98.0%
Taylor expanded in y around 0
Applied rewrites91.7%
Final simplification75.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) y)) (t_2 (fma (log y) x (log t))))
(if (<= t_1 -1e+179)
(- t_2 y)
(if (<= t_1 -0.01) (- (- (log t) y) z) (- t_2 z)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double t_2 = fma(log(y), x, log(t));
double tmp;
if (t_1 <= -1e+179) {
tmp = t_2 - y;
} else if (t_1 <= -0.01) {
tmp = (log(t) - y) - z;
} else {
tmp = t_2 - z;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - y) t_2 = fma(log(y), x, log(t)) tmp = 0.0 if (t_1 <= -1e+179) tmp = Float64(t_2 - y); elseif (t_1 <= -0.01) tmp = Float64(Float64(log(t) - y) - z); else tmp = Float64(t_2 - z); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+179], N[(t$95$2 - y), $MachinePrecision], If[LessEqual[t$95$1, -0.01], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(t$95$2 - z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
t_2 := \mathsf{fma}\left(\log y, x, \log t\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+179}:\\
\;\;\;\;t\_2 - y\\
\mathbf{elif}\;t\_1 \leq -0.01:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;t\_2 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -9.9999999999999998e178Initial program 99.8%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6493.4
Applied rewrites93.4%
if -9.9999999999999998e178 < (-.f64 (*.f64 x (log.f64 y)) y) < -0.0100000000000000002Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6492.1
Applied rewrites92.1%
if -0.0100000000000000002 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6499.8
Applied rewrites99.8%
Final simplification96.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1e+46) (not (<= x 7.4e+171))) (- (fma (log y) x (log t)) y) (- (- (log t) y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1e+46) || !(x <= 7.4e+171)) {
tmp = fma(log(y), x, log(t)) - y;
} else {
tmp = (log(t) - y) - z;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((x <= -1e+46) || !(x <= 7.4e+171)) tmp = Float64(fma(log(y), x, log(t)) - y); else tmp = Float64(Float64(log(t) - y) - z); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1e+46], N[Not[LessEqual[x, 7.4e+171]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+46} \lor \neg \left(x \leq 7.4 \cdot 10^{+171}\right):\\
\;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\end{array}
\end{array}
if x < -9.9999999999999999e45 or 7.39999999999999996e171 < x Initial program 99.6%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6487.7
Applied rewrites87.7%
if -9.9999999999999999e45 < x < 7.39999999999999996e171Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6496.1
Applied rewrites96.1%
Final simplification93.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.3e+129) (not (<= x 6.5e+141))) (* (log y) x) (- (- (log t) y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.3e+129) || !(x <= 6.5e+141)) {
tmp = log(y) * x;
} 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.3d+129)) .or. (.not. (x <= 6.5d+141))) then
tmp = log(y) * x
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.3e+129) || !(x <= 6.5e+141)) {
tmp = Math.log(y) * x;
} else {
tmp = (Math.log(t) - y) - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.3e+129) or not (x <= 6.5e+141): tmp = math.log(y) * x else: tmp = (math.log(t) - y) - z return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.3e+129) || !(x <= 6.5e+141)) tmp = Float64(log(y) * x); else tmp = Float64(Float64(log(t) - y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.3e+129) || ~((x <= 6.5e+141))) tmp = log(y) * x; else tmp = (log(t) - y) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.3e+129], N[Not[LessEqual[x, 6.5e+141]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+129} \lor \neg \left(x \leq 6.5 \cdot 10^{+141}\right):\\
\;\;\;\;\log y \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\end{array}
\end{array}
if x < -2.2999999999999999e129 or 6.50000000000000053e141 < x Initial program 99.6%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6474.4
Applied rewrites74.4%
if -2.2999999999999999e129 < x < 6.50000000000000053e141Initial program 99.9%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6492.9
Applied rewrites92.9%
Final simplification87.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -8500000000000.0) (not (<= z 6.5e+48))) (- z) (- (log t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8500000000000.0) || !(z <= 6.5e+48)) {
tmp = -z;
} 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 ((z <= (-8500000000000.0d0)) .or. (.not. (z <= 6.5d+48))) then
tmp = -z
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 ((z <= -8500000000000.0) || !(z <= 6.5e+48)) {
tmp = -z;
} else {
tmp = Math.log(t) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -8500000000000.0) or not (z <= 6.5e+48): tmp = -z else: tmp = math.log(t) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -8500000000000.0) || !(z <= 6.5e+48)) tmp = Float64(-z); else tmp = Float64(log(t) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -8500000000000.0) || ~((z <= 6.5e+48))) tmp = -z; else tmp = log(t) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8500000000000.0], N[Not[LessEqual[z, 6.5e+48]], $MachinePrecision]], (-z), N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8500000000000 \lor \neg \left(z \leq 6.5 \cdot 10^{+48}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;\log t - y\\
\end{array}
\end{array}
if z < -8.5e12 or 6.49999999999999972e48 < z Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6466.7
Applied rewrites66.7%
if -8.5e12 < z < 6.49999999999999972e48Initial program 99.8%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6498.1
Applied rewrites98.1%
Taylor expanded in x around 0
Applied rewrites65.1%
Final simplification65.8%
(FPCore (x y z t) :precision binary64 (if (<= z -7800000000.0) (- (log t) z) (if (<= z 6.5e+48) (- (log t) y) (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7800000000.0) {
tmp = log(t) - z;
} else if (z <= 6.5e+48) {
tmp = log(t) - y;
} else {
tmp = -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 (z <= (-7800000000.0d0)) then
tmp = log(t) - z
else if (z <= 6.5d+48) then
tmp = log(t) - y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7800000000.0) {
tmp = Math.log(t) - z;
} else if (z <= 6.5e+48) {
tmp = Math.log(t) - y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7800000000.0: tmp = math.log(t) - z elif z <= 6.5e+48: tmp = math.log(t) - y else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7800000000.0) tmp = Float64(log(t) - z); elseif (z <= 6.5e+48) tmp = Float64(log(t) - y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -7800000000.0) tmp = log(t) - z; elseif (z <= 6.5e+48) tmp = log(t) - y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7800000000.0], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], If[LessEqual[z, 6.5e+48], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7800000000:\\
\;\;\;\;\log t - z\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+48}:\\
\;\;\;\;\log t - y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -7.8e9Initial program 99.9%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.7%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6483.0
Applied rewrites83.0%
Taylor expanded in y around 0
Applied rewrites64.5%
if -7.8e9 < z < 6.49999999999999972e48Initial program 99.8%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6498.1
Applied rewrites98.1%
Taylor expanded in x around 0
Applied rewrites65.1%
if 6.49999999999999972e48 < z Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6470.1
Applied rewrites70.1%
Final simplification65.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -8500000000000.0) (not (<= z 6.5e+48))) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8500000000000.0) || !(z <= 6.5e+48)) {
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 ((z <= (-8500000000000.0d0)) .or. (.not. (z <= 6.5d+48))) 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 ((z <= -8500000000000.0) || !(z <= 6.5e+48)) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -8500000000000.0) or not (z <= 6.5e+48): tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -8500000000000.0) || !(z <= 6.5e+48)) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -8500000000000.0) || ~((z <= 6.5e+48))) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8500000000000.0], N[Not[LessEqual[z, 6.5e+48]], $MachinePrecision]], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8500000000000 \lor \neg \left(z \leq 6.5 \cdot 10^{+48}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if z < -8.5e12 or 6.49999999999999972e48 < z Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6466.7
Applied rewrites66.7%
if -8.5e12 < z < 6.49999999999999972e48Initial program 99.8%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.7%
Applied rewrites99.6%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6434.9
Applied rewrites34.9%
Final simplification48.3%
(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%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.7%
Applied rewrites99.7%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6427.0
Applied rewrites27.0%
herbie shell --seed 2024318
(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)))