
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - 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 = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - 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 = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x_s x_m y z t) :precision binary64 (let* ((t_1 (/ x_m (* (- y z) (- t z))))) (* x_s (if (<= t_1 -1e-243) t_1 (/ (/ x_m (- t z)) (- y z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / ((y - z) * (t - z));
double tmp;
if (t_1 <= -1e-243) {
tmp = t_1;
} else {
tmp = (x_m / (t - z)) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x_m / ((y - z) * (t - z))
if (t_1 <= (-1d-243)) then
tmp = t_1
else
tmp = (x_m / (t - z)) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / ((y - z) * (t - z));
double tmp;
if (t_1 <= -1e-243) {
tmp = t_1;
} else {
tmp = (x_m / (t - z)) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = x_m / ((y - z) * (t - z)) tmp = 0 if t_1 <= -1e-243: tmp = t_1 else: tmp = (x_m / (t - z)) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))) tmp = 0.0 if (t_1 <= -1e-243) tmp = t_1; else tmp = Float64(Float64(x_m / Float64(t - z)) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = x_m / ((y - z) * (t - z));
tmp = 0.0;
if (t_1 <= -1e-243)
tmp = t_1;
else
tmp = (x_m / (t - z)) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, -1e-243], t$95$1, N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-243}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y - z}\\
\end{array}
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -9.99999999999999995e-244Initial program 96.0%
if -9.99999999999999995e-244 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 86.1%
associate-/l/98.0%
Simplified98.0%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (/ x_m t) y)) (t_2 (/ x_m (* z (- z y)))))
(*
x_s
(if (<= z -3.8e-25)
t_2
(if (<= z -2.35e-122)
t_1
(if (<= z -1.5e-144)
t_2
(if (<= z 2.1e-202)
(/ (/ 1.0 t) (/ y x_m))
(if (<= z 3.2e-186)
(/ x_m (* z (- z t)))
(if (<= z 5.6e-39)
t_1
(if (<= z 3.6e+138) t_2 (* (/ x_m z) (/ 1.0 z))))))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / t) / y;
double t_2 = x_m / (z * (z - y));
double tmp;
if (z <= -3.8e-25) {
tmp = t_2;
} else if (z <= -2.35e-122) {
tmp = t_1;
} else if (z <= -1.5e-144) {
tmp = t_2;
} else if (z <= 2.1e-202) {
tmp = (1.0 / t) / (y / x_m);
} else if (z <= 3.2e-186) {
tmp = x_m / (z * (z - t));
} else if (z <= 5.6e-39) {
tmp = t_1;
} else if (z <= 3.6e+138) {
tmp = t_2;
} else {
tmp = (x_m / z) * (1.0 / z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
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_m / t) / y
t_2 = x_m / (z * (z - y))
if (z <= (-3.8d-25)) then
tmp = t_2
else if (z <= (-2.35d-122)) then
tmp = t_1
else if (z <= (-1.5d-144)) then
tmp = t_2
else if (z <= 2.1d-202) then
tmp = (1.0d0 / t) / (y / x_m)
else if (z <= 3.2d-186) then
tmp = x_m / (z * (z - t))
else if (z <= 5.6d-39) then
tmp = t_1
else if (z <= 3.6d+138) then
tmp = t_2
else
tmp = (x_m / z) * (1.0d0 / z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / t) / y;
double t_2 = x_m / (z * (z - y));
double tmp;
if (z <= -3.8e-25) {
tmp = t_2;
} else if (z <= -2.35e-122) {
tmp = t_1;
} else if (z <= -1.5e-144) {
tmp = t_2;
} else if (z <= 2.1e-202) {
tmp = (1.0 / t) / (y / x_m);
} else if (z <= 3.2e-186) {
tmp = x_m / (z * (z - t));
} else if (z <= 5.6e-39) {
tmp = t_1;
} else if (z <= 3.6e+138) {
tmp = t_2;
} else {
tmp = (x_m / z) * (1.0 / z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = (x_m / t) / y t_2 = x_m / (z * (z - y)) tmp = 0 if z <= -3.8e-25: tmp = t_2 elif z <= -2.35e-122: tmp = t_1 elif z <= -1.5e-144: tmp = t_2 elif z <= 2.1e-202: tmp = (1.0 / t) / (y / x_m) elif z <= 3.2e-186: tmp = x_m / (z * (z - t)) elif z <= 5.6e-39: tmp = t_1 elif z <= 3.6e+138: tmp = t_2 else: tmp = (x_m / z) * (1.0 / z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(x_m / t) / y) t_2 = Float64(x_m / Float64(z * Float64(z - y))) tmp = 0.0 if (z <= -3.8e-25) tmp = t_2; elseif (z <= -2.35e-122) tmp = t_1; elseif (z <= -1.5e-144) tmp = t_2; elseif (z <= 2.1e-202) tmp = Float64(Float64(1.0 / t) / Float64(y / x_m)); elseif (z <= 3.2e-186) tmp = Float64(x_m / Float64(z * Float64(z - t))); elseif (z <= 5.6e-39) tmp = t_1; elseif (z <= 3.6e+138) tmp = t_2; else tmp = Float64(Float64(x_m / z) * Float64(1.0 / z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = (x_m / t) / y;
t_2 = x_m / (z * (z - y));
tmp = 0.0;
if (z <= -3.8e-25)
tmp = t_2;
elseif (z <= -2.35e-122)
tmp = t_1;
elseif (z <= -1.5e-144)
tmp = t_2;
elseif (z <= 2.1e-202)
tmp = (1.0 / t) / (y / x_m);
elseif (z <= 3.2e-186)
tmp = x_m / (z * (z - t));
elseif (z <= 5.6e-39)
tmp = t_1;
elseif (z <= 3.6e+138)
tmp = t_2;
else
tmp = (x_m / z) * (1.0 / z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -3.8e-25], t$95$2, If[LessEqual[z, -2.35e-122], t$95$1, If[LessEqual[z, -1.5e-144], t$95$2, If[LessEqual[z, 2.1e-202], N[(N[(1.0 / t), $MachinePrecision] / N[(y / x$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e-186], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e-39], t$95$1, If[LessEqual[z, 3.6e+138], t$95$2, N[(N[(x$95$m / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]]]]]]]), $MachinePrecision]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{t}}{y}\\
t_2 := \frac{x\_m}{z \cdot \left(z - y\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{-25}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-144}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-202}:\\
\;\;\;\;\frac{\frac{1}{t}}{\frac{y}{x\_m}}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-186}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+138}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\
\end{array}
\end{array}
\end{array}
if z < -3.7999999999999998e-25 or -2.35e-122 < z < -1.4999999999999999e-144 or 5.6000000000000003e-39 < z < 3.6000000000000001e138Initial program 93.5%
Taylor expanded in t around 0 74.4%
mul-1-neg74.4%
distribute-rgt-neg-in74.4%
neg-sub074.4%
sub-neg74.4%
+-commutative74.4%
associate--r+74.4%
neg-sub074.4%
remove-double-neg74.4%
Simplified74.4%
if -3.7999999999999998e-25 < z < -2.35e-122 or 3.2e-186 < z < 5.6000000000000003e-39Initial program 88.7%
associate-/l/93.5%
clear-num93.6%
inv-pow93.6%
div-inv93.5%
clear-num93.6%
Applied egg-rr93.6%
unpow-193.6%
Simplified93.6%
Taylor expanded in z around 0 57.9%
associate-/r*64.7%
Simplified64.7%
if -1.4999999999999999e-144 < z < 2.09999999999999985e-202Initial program 85.4%
associate-/r*91.5%
div-inv91.5%
Applied egg-rr91.5%
Taylor expanded in t around inf 87.1%
Taylor expanded in y around inf 78.9%
*-commutative78.9%
clear-num78.9%
un-div-inv79.6%
Applied egg-rr79.6%
if 2.09999999999999985e-202 < z < 3.2e-186Initial program 100.0%
Taylor expanded in y around 0 50.3%
mul-1-neg50.3%
distribute-rgt-neg-in50.3%
sub-neg50.3%
+-commutative50.3%
distribute-neg-in50.3%
remove-double-neg50.3%
unsub-neg50.3%
Simplified50.3%
if 3.6000000000000001e138 < z Initial program 71.6%
Taylor expanded in t around 0 69.7%
mul-1-neg69.7%
distribute-rgt-neg-in69.7%
neg-sub069.7%
sub-neg69.7%
+-commutative69.7%
associate--r+69.7%
neg-sub069.7%
remove-double-neg69.7%
Simplified69.7%
Taylor expanded in z around inf 69.7%
associate-/r*92.1%
div-inv92.1%
Applied egg-rr92.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (/ x_m t) y)) (t_2 (/ x_m (* z (- z y)))))
(*
x_s
(if (<= z -9.8e-25)
t_2
(if (<= z -2.45e-122)
t_1
(if (<= z -7.6e-143)
t_2
(if (<= z 2.1e-202)
(/ (/ x_m y) t)
(if (<= z 3.5e-186)
(/ x_m (* z (- z t)))
(if (<= z 3.4e-39)
t_1
(if (<= z 3.8e+138) t_2 (* (/ x_m z) (/ 1.0 z))))))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / t) / y;
double t_2 = x_m / (z * (z - y));
double tmp;
if (z <= -9.8e-25) {
tmp = t_2;
} else if (z <= -2.45e-122) {
tmp = t_1;
} else if (z <= -7.6e-143) {
tmp = t_2;
} else if (z <= 2.1e-202) {
tmp = (x_m / y) / t;
} else if (z <= 3.5e-186) {
tmp = x_m / (z * (z - t));
} else if (z <= 3.4e-39) {
tmp = t_1;
} else if (z <= 3.8e+138) {
tmp = t_2;
} else {
tmp = (x_m / z) * (1.0 / z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
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_m / t) / y
t_2 = x_m / (z * (z - y))
if (z <= (-9.8d-25)) then
tmp = t_2
else if (z <= (-2.45d-122)) then
tmp = t_1
else if (z <= (-7.6d-143)) then
tmp = t_2
else if (z <= 2.1d-202) then
tmp = (x_m / y) / t
else if (z <= 3.5d-186) then
tmp = x_m / (z * (z - t))
else if (z <= 3.4d-39) then
tmp = t_1
else if (z <= 3.8d+138) then
tmp = t_2
else
tmp = (x_m / z) * (1.0d0 / z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / t) / y;
double t_2 = x_m / (z * (z - y));
double tmp;
if (z <= -9.8e-25) {
tmp = t_2;
} else if (z <= -2.45e-122) {
tmp = t_1;
} else if (z <= -7.6e-143) {
tmp = t_2;
} else if (z <= 2.1e-202) {
tmp = (x_m / y) / t;
} else if (z <= 3.5e-186) {
tmp = x_m / (z * (z - t));
} else if (z <= 3.4e-39) {
tmp = t_1;
} else if (z <= 3.8e+138) {
tmp = t_2;
} else {
tmp = (x_m / z) * (1.0 / z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = (x_m / t) / y t_2 = x_m / (z * (z - y)) tmp = 0 if z <= -9.8e-25: tmp = t_2 elif z <= -2.45e-122: tmp = t_1 elif z <= -7.6e-143: tmp = t_2 elif z <= 2.1e-202: tmp = (x_m / y) / t elif z <= 3.5e-186: tmp = x_m / (z * (z - t)) elif z <= 3.4e-39: tmp = t_1 elif z <= 3.8e+138: tmp = t_2 else: tmp = (x_m / z) * (1.0 / z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(x_m / t) / y) t_2 = Float64(x_m / Float64(z * Float64(z - y))) tmp = 0.0 if (z <= -9.8e-25) tmp = t_2; elseif (z <= -2.45e-122) tmp = t_1; elseif (z <= -7.6e-143) tmp = t_2; elseif (z <= 2.1e-202) tmp = Float64(Float64(x_m / y) / t); elseif (z <= 3.5e-186) tmp = Float64(x_m / Float64(z * Float64(z - t))); elseif (z <= 3.4e-39) tmp = t_1; elseif (z <= 3.8e+138) tmp = t_2; else tmp = Float64(Float64(x_m / z) * Float64(1.0 / z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = (x_m / t) / y;
t_2 = x_m / (z * (z - y));
tmp = 0.0;
if (z <= -9.8e-25)
tmp = t_2;
elseif (z <= -2.45e-122)
tmp = t_1;
elseif (z <= -7.6e-143)
tmp = t_2;
elseif (z <= 2.1e-202)
tmp = (x_m / y) / t;
elseif (z <= 3.5e-186)
tmp = x_m / (z * (z - t));
elseif (z <= 3.4e-39)
tmp = t_1;
elseif (z <= 3.8e+138)
tmp = t_2;
else
tmp = (x_m / z) * (1.0 / z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -9.8e-25], t$95$2, If[LessEqual[z, -2.45e-122], t$95$1, If[LessEqual[z, -7.6e-143], t$95$2, If[LessEqual[z, 2.1e-202], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3.5e-186], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e-39], t$95$1, If[LessEqual[z, 3.8e+138], t$95$2, N[(N[(x$95$m / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]]]]]]]), $MachinePrecision]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{t}}{y}\\
t_2 := \frac{x\_m}{z \cdot \left(z - y\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{-25}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{-122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7.6 \cdot 10^{-143}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-202}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-186}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+138}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\
\end{array}
\end{array}
\end{array}
if z < -9.7999999999999998e-25 or -2.4499999999999998e-122 < z < -7.59999999999999962e-143 or 3.3999999999999999e-39 < z < 3.80000000000000012e138Initial program 93.5%
Taylor expanded in t around 0 74.4%
mul-1-neg74.4%
distribute-rgt-neg-in74.4%
neg-sub074.4%
sub-neg74.4%
+-commutative74.4%
associate--r+74.4%
neg-sub074.4%
remove-double-neg74.4%
Simplified74.4%
if -9.7999999999999998e-25 < z < -2.4499999999999998e-122 or 3.49999999999999989e-186 < z < 3.3999999999999999e-39Initial program 88.7%
associate-/l/93.5%
clear-num93.6%
inv-pow93.6%
div-inv93.5%
clear-num93.6%
Applied egg-rr93.6%
unpow-193.6%
Simplified93.6%
Taylor expanded in z around 0 57.9%
associate-/r*64.7%
Simplified64.7%
if -7.59999999999999962e-143 < z < 2.09999999999999985e-202Initial program 85.4%
Taylor expanded in y around inf 75.2%
associate-/r*83.3%
Simplified83.3%
Taylor expanded in t around inf 79.0%
if 2.09999999999999985e-202 < z < 3.49999999999999989e-186Initial program 100.0%
Taylor expanded in y around 0 50.3%
mul-1-neg50.3%
distribute-rgt-neg-in50.3%
sub-neg50.3%
+-commutative50.3%
distribute-neg-in50.3%
remove-double-neg50.3%
unsub-neg50.3%
Simplified50.3%
if 3.80000000000000012e138 < z Initial program 71.6%
Taylor expanded in t around 0 69.7%
mul-1-neg69.7%
distribute-rgt-neg-in69.7%
neg-sub069.7%
sub-neg69.7%
+-commutative69.7%
associate--r+69.7%
neg-sub069.7%
remove-double-neg69.7%
Simplified69.7%
Taylor expanded in z around inf 69.7%
associate-/r*92.1%
div-inv92.1%
Applied egg-rr92.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ x_m (* z (- z t)))))
(*
x_s
(if (<= z -4.5e-19)
t_1
(if (<= z 2.1e-202)
(/ (/ x_m y) t)
(if (<= z 3.2e-186)
t_1
(if (<= z 1.3e-38)
(/ (/ x_m t) y)
(if (<= z 1e+139) t_1 (* (/ x_m z) (/ 1.0 z))))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (z * (z - t));
double tmp;
if (z <= -4.5e-19) {
tmp = t_1;
} else if (z <= 2.1e-202) {
tmp = (x_m / y) / t;
} else if (z <= 3.2e-186) {
tmp = t_1;
} else if (z <= 1.3e-38) {
tmp = (x_m / t) / y;
} else if (z <= 1e+139) {
tmp = t_1;
} else {
tmp = (x_m / z) * (1.0 / z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x_m / (z * (z - t))
if (z <= (-4.5d-19)) then
tmp = t_1
else if (z <= 2.1d-202) then
tmp = (x_m / y) / t
else if (z <= 3.2d-186) then
tmp = t_1
else if (z <= 1.3d-38) then
tmp = (x_m / t) / y
else if (z <= 1d+139) then
tmp = t_1
else
tmp = (x_m / z) * (1.0d0 / z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (z * (z - t));
double tmp;
if (z <= -4.5e-19) {
tmp = t_1;
} else if (z <= 2.1e-202) {
tmp = (x_m / y) / t;
} else if (z <= 3.2e-186) {
tmp = t_1;
} else if (z <= 1.3e-38) {
tmp = (x_m / t) / y;
} else if (z <= 1e+139) {
tmp = t_1;
} else {
tmp = (x_m / z) * (1.0 / z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = x_m / (z * (z - t)) tmp = 0 if z <= -4.5e-19: tmp = t_1 elif z <= 2.1e-202: tmp = (x_m / y) / t elif z <= 3.2e-186: tmp = t_1 elif z <= 1.3e-38: tmp = (x_m / t) / y elif z <= 1e+139: tmp = t_1 else: tmp = (x_m / z) * (1.0 / z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m / Float64(z * Float64(z - t))) tmp = 0.0 if (z <= -4.5e-19) tmp = t_1; elseif (z <= 2.1e-202) tmp = Float64(Float64(x_m / y) / t); elseif (z <= 3.2e-186) tmp = t_1; elseif (z <= 1.3e-38) tmp = Float64(Float64(x_m / t) / y); elseif (z <= 1e+139) tmp = t_1; else tmp = Float64(Float64(x_m / z) * Float64(1.0 / z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = x_m / (z * (z - t));
tmp = 0.0;
if (z <= -4.5e-19)
tmp = t_1;
elseif (z <= 2.1e-202)
tmp = (x_m / y) / t;
elseif (z <= 3.2e-186)
tmp = t_1;
elseif (z <= 1.3e-38)
tmp = (x_m / t) / y;
elseif (z <= 1e+139)
tmp = t_1;
else
tmp = (x_m / z) * (1.0 / z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -4.5e-19], t$95$1, If[LessEqual[z, 2.1e-202], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3.2e-186], t$95$1, If[LessEqual[z, 1.3e-38], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1e+139], t$95$1, N[(N[(x$95$m / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z \cdot \left(z - t\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-202}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-186}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-38}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{elif}\;z \leq 10^{+139}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\
\end{array}
\end{array}
\end{array}
if z < -4.50000000000000013e-19 or 2.09999999999999985e-202 < z < 3.2e-186 or 1.30000000000000005e-38 < z < 1.00000000000000003e139Initial program 93.5%
Taylor expanded in y around 0 74.9%
mul-1-neg74.9%
distribute-rgt-neg-in74.9%
sub-neg74.9%
+-commutative74.9%
distribute-neg-in74.9%
remove-double-neg74.9%
unsub-neg74.9%
Simplified74.9%
if -4.50000000000000013e-19 < z < 2.09999999999999985e-202Initial program 87.1%
Taylor expanded in y around inf 69.5%
associate-/r*76.9%
Simplified76.9%
Taylor expanded in t around inf 69.1%
if 3.2e-186 < z < 1.30000000000000005e-38Initial program 89.7%
associate-/l/92.6%
clear-num92.6%
inv-pow92.6%
div-inv92.6%
clear-num92.8%
Applied egg-rr92.8%
unpow-192.8%
Simplified92.8%
Taylor expanded in z around 0 58.6%
associate-/r*62.0%
Simplified62.0%
if 1.00000000000000003e139 < z Initial program 70.7%
Taylor expanded in t around 0 70.7%
mul-1-neg70.7%
distribute-rgt-neg-in70.7%
neg-sub070.7%
sub-neg70.7%
+-commutative70.7%
associate--r+70.7%
neg-sub070.7%
remove-double-neg70.7%
Simplified70.7%
Taylor expanded in z around inf 70.7%
associate-/r*93.8%
div-inv93.8%
Applied egg-rr93.8%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -82000000000000.0)
(/ (/ x_m y) (- t z))
(if (<= y -3.1e-59)
(/ (/ x_m z) (- z y))
(if (<= y -3.5e-80)
(* (/ 1.0 t) (/ x_m (- y z)))
(if (<= y 1.2e-100) (/ (/ x_m z) (- z t)) (/ (/ x_m t) (- y z))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -82000000000000.0) {
tmp = (x_m / y) / (t - z);
} else if (y <= -3.1e-59) {
tmp = (x_m / z) / (z - y);
} else if (y <= -3.5e-80) {
tmp = (1.0 / t) * (x_m / (y - z));
} else if (y <= 1.2e-100) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-82000000000000.0d0)) then
tmp = (x_m / y) / (t - z)
else if (y <= (-3.1d-59)) then
tmp = (x_m / z) / (z - y)
else if (y <= (-3.5d-80)) then
tmp = (1.0d0 / t) * (x_m / (y - z))
else if (y <= 1.2d-100) then
tmp = (x_m / z) / (z - t)
else
tmp = (x_m / t) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -82000000000000.0) {
tmp = (x_m / y) / (t - z);
} else if (y <= -3.1e-59) {
tmp = (x_m / z) / (z - y);
} else if (y <= -3.5e-80) {
tmp = (1.0 / t) * (x_m / (y - z));
} else if (y <= 1.2e-100) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -82000000000000.0: tmp = (x_m / y) / (t - z) elif y <= -3.1e-59: tmp = (x_m / z) / (z - y) elif y <= -3.5e-80: tmp = (1.0 / t) * (x_m / (y - z)) elif y <= 1.2e-100: tmp = (x_m / z) / (z - t) else: tmp = (x_m / t) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -82000000000000.0) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= -3.1e-59) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (y <= -3.5e-80) tmp = Float64(Float64(1.0 / t) * Float64(x_m / Float64(y - z))); elseif (y <= 1.2e-100) tmp = Float64(Float64(x_m / z) / Float64(z - t)); else tmp = Float64(Float64(x_m / t) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (y <= -82000000000000.0)
tmp = (x_m / y) / (t - z);
elseif (y <= -3.1e-59)
tmp = (x_m / z) / (z - y);
elseif (y <= -3.5e-80)
tmp = (1.0 / t) * (x_m / (y - z));
elseif (y <= 1.2e-100)
tmp = (x_m / z) / (z - t);
else
tmp = (x_m / t) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -82000000000000.0], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.1e-59], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.5e-80], N[(N[(1.0 / t), $MachinePrecision] * N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e-100], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -82000000000000:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq -3.1 \cdot 10^{-59}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-80}:\\
\;\;\;\;\frac{1}{t} \cdot \frac{x\_m}{y - z}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-100}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -8.2e13Initial program 90.8%
Taylor expanded in y around inf 87.9%
associate-/r*93.9%
Simplified93.9%
if -8.2e13 < y < -3.09999999999999999e-59Initial program 95.0%
Taylor expanded in t around 0 57.0%
mul-1-neg57.0%
associate-/r*61.8%
distribute-neg-frac261.8%
neg-sub061.8%
sub-neg61.8%
+-commutative61.8%
associate--r+61.8%
neg-sub061.8%
remove-double-neg61.8%
Simplified61.8%
if -3.09999999999999999e-59 < y < -3.50000000000000015e-80Initial program 81.6%
associate-/r*99.7%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in t around inf 99.7%
if -3.50000000000000015e-80 < y < 1.2000000000000001e-100Initial program 93.8%
Taylor expanded in y around 0 79.9%
mul-1-neg79.9%
associate-/r*80.0%
distribute-neg-frac280.0%
sub-neg80.0%
+-commutative80.0%
distribute-neg-in80.0%
remove-double-neg80.0%
unsub-neg80.0%
Simplified80.0%
if 1.2000000000000001e-100 < y Initial program 78.9%
associate-/l/98.5%
Simplified98.5%
Taylor expanded in t around inf 61.3%
Final simplification75.8%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -2.3e+14)
(/ (/ x_m y) (- t z))
(if (<= y -2.2e-76)
(/ (/ x_m z) (- z y))
(if (<= y -5.8e-79)
(/ x_m (* y t))
(if (<= y 5e-100) (/ (/ x_m z) (- z t)) (/ (/ x_m t) (- y z))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -2.3e+14) {
tmp = (x_m / y) / (t - z);
} else if (y <= -2.2e-76) {
tmp = (x_m / z) / (z - y);
} else if (y <= -5.8e-79) {
tmp = x_m / (y * t);
} else if (y <= 5e-100) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.3d+14)) then
tmp = (x_m / y) / (t - z)
else if (y <= (-2.2d-76)) then
tmp = (x_m / z) / (z - y)
else if (y <= (-5.8d-79)) then
tmp = x_m / (y * t)
else if (y <= 5d-100) then
tmp = (x_m / z) / (z - t)
else
tmp = (x_m / t) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -2.3e+14) {
tmp = (x_m / y) / (t - z);
} else if (y <= -2.2e-76) {
tmp = (x_m / z) / (z - y);
} else if (y <= -5.8e-79) {
tmp = x_m / (y * t);
} else if (y <= 5e-100) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -2.3e+14: tmp = (x_m / y) / (t - z) elif y <= -2.2e-76: tmp = (x_m / z) / (z - y) elif y <= -5.8e-79: tmp = x_m / (y * t) elif y <= 5e-100: tmp = (x_m / z) / (z - t) else: tmp = (x_m / t) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -2.3e+14) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= -2.2e-76) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (y <= -5.8e-79) tmp = Float64(x_m / Float64(y * t)); elseif (y <= 5e-100) tmp = Float64(Float64(x_m / z) / Float64(z - t)); else tmp = Float64(Float64(x_m / t) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (y <= -2.3e+14)
tmp = (x_m / y) / (t - z);
elseif (y <= -2.2e-76)
tmp = (x_m / z) / (z - y);
elseif (y <= -5.8e-79)
tmp = x_m / (y * t);
elseif (y <= 5e-100)
tmp = (x_m / z) / (z - t);
else
tmp = (x_m / t) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -2.3e+14], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.2e-76], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.8e-79], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-100], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+14}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq -2.2 \cdot 10^{-76}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;y \leq -5.8 \cdot 10^{-79}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-100}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -2.3e14Initial program 90.8%
Taylor expanded in y around inf 87.9%
associate-/r*93.9%
Simplified93.9%
if -2.3e14 < y < -2.19999999999999999e-76Initial program 95.6%
Taylor expanded in t around 0 58.4%
mul-1-neg58.4%
associate-/r*62.7%
distribute-neg-frac262.7%
neg-sub062.7%
sub-neg62.7%
+-commutative62.7%
associate--r+62.7%
neg-sub062.7%
remove-double-neg62.7%
Simplified62.7%
if -2.19999999999999999e-76 < y < -5.8000000000000001e-79Initial program 100.0%
Taylor expanded in z around 0 100.0%
if -5.8000000000000001e-79 < y < 5.0000000000000001e-100Initial program 92.9%
Taylor expanded in y around 0 79.1%
mul-1-neg79.1%
associate-/r*80.2%
distribute-neg-frac280.2%
sub-neg80.2%
+-commutative80.2%
distribute-neg-in80.2%
remove-double-neg80.2%
unsub-neg80.2%
Simplified80.2%
if 5.0000000000000001e-100 < y Initial program 78.9%
associate-/l/98.5%
Simplified98.5%
Taylor expanded in t around inf 61.3%
Final simplification75.4%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= t -480.0) (not (<= t 5.2e-61)))
(/ (/ x_m t) (- y z))
(/ x_m (* z (- z y))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((t <= -480.0) || !(t <= 5.2e-61)) {
tmp = (x_m / t) / (y - z);
} else {
tmp = x_m / (z * (z - y));
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-480.0d0)) .or. (.not. (t <= 5.2d-61))) then
tmp = (x_m / t) / (y - z)
else
tmp = x_m / (z * (z - y))
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((t <= -480.0) || !(t <= 5.2e-61)) {
tmp = (x_m / t) / (y - z);
} else {
tmp = x_m / (z * (z - y));
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (t <= -480.0) or not (t <= 5.2e-61): tmp = (x_m / t) / (y - z) else: tmp = x_m / (z * (z - y)) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((t <= -480.0) || !(t <= 5.2e-61)) tmp = Float64(Float64(x_m / t) / Float64(y - z)); else tmp = Float64(x_m / Float64(z * Float64(z - y))); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((t <= -480.0) || ~((t <= 5.2e-61)))
tmp = (x_m / t) / (y - z);
else
tmp = x_m / (z * (z - y));
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[t, -480.0], N[Not[LessEqual[t, 5.2e-61]], $MachinePrecision]], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -480 \lor \neg \left(t \leq 5.2 \cdot 10^{-61}\right):\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\end{array}
\end{array}
if t < -480 or 5.20000000000000021e-61 < t Initial program 86.2%
associate-/l/97.2%
Simplified97.2%
Taylor expanded in t around inf 85.8%
if -480 < t < 5.20000000000000021e-61Initial program 91.0%
Taylor expanded in t around 0 77.1%
mul-1-neg77.1%
distribute-rgt-neg-in77.1%
neg-sub077.1%
sub-neg77.1%
+-commutative77.1%
associate--r+77.1%
neg-sub077.1%
remove-double-neg77.1%
Simplified77.1%
Final simplification82.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -130000000.0) (not (<= z 9.2e+25)))
(* (/ x_m z) (/ 1.0 z))
(/ (/ x_m y) t))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -130000000.0) || !(z <= 9.2e+25)) {
tmp = (x_m / z) * (1.0 / z);
} else {
tmp = (x_m / y) / t;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-130000000.0d0)) .or. (.not. (z <= 9.2d+25))) then
tmp = (x_m / z) * (1.0d0 / z)
else
tmp = (x_m / y) / t
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -130000000.0) || !(z <= 9.2e+25)) {
tmp = (x_m / z) * (1.0 / z);
} else {
tmp = (x_m / y) / t;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -130000000.0) or not (z <= 9.2e+25): tmp = (x_m / z) * (1.0 / z) else: tmp = (x_m / y) / t return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -130000000.0) || !(z <= 9.2e+25)) tmp = Float64(Float64(x_m / z) * Float64(1.0 / z)); else tmp = Float64(Float64(x_m / y) / t); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -130000000.0) || ~((z <= 9.2e+25)))
tmp = (x_m / z) * (1.0 / z);
else
tmp = (x_m / y) / t;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -130000000.0], N[Not[LessEqual[z, 9.2e+25]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -130000000 \lor \neg \left(z \leq 9.2 \cdot 10^{+25}\right):\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\end{array}
\end{array}
if z < -1.3e8 or 9.1999999999999992e25 < z Initial program 86.0%
Taylor expanded in t around 0 80.3%
mul-1-neg80.3%
distribute-rgt-neg-in80.3%
neg-sub080.3%
sub-neg80.3%
+-commutative80.3%
associate--r+80.3%
neg-sub080.3%
remove-double-neg80.3%
Simplified80.3%
Taylor expanded in z around inf 70.5%
associate-/r*79.2%
div-inv79.2%
Applied egg-rr79.2%
if -1.3e8 < z < 9.1999999999999992e25Initial program 89.9%
Taylor expanded in y around inf 63.0%
associate-/r*68.4%
Simplified68.4%
Taylor expanded in t around inf 58.5%
Final simplification67.5%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -5.8e-22)
(/ (/ x_m y) (- t z))
(if (<= y 2.1e-100) (/ (/ x_m z) (- z t)) (/ (/ x_m t) (- y z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -5.8e-22) {
tmp = (x_m / y) / (t - z);
} else if (y <= 2.1e-100) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-5.8d-22)) then
tmp = (x_m / y) / (t - z)
else if (y <= 2.1d-100) then
tmp = (x_m / z) / (z - t)
else
tmp = (x_m / t) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -5.8e-22) {
tmp = (x_m / y) / (t - z);
} else if (y <= 2.1e-100) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -5.8e-22: tmp = (x_m / y) / (t - z) elif y <= 2.1e-100: tmp = (x_m / z) / (z - t) else: tmp = (x_m / t) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -5.8e-22) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= 2.1e-100) tmp = Float64(Float64(x_m / z) / Float64(z - t)); else tmp = Float64(Float64(x_m / t) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (y <= -5.8e-22)
tmp = (x_m / y) / (t - z);
elseif (y <= 2.1e-100)
tmp = (x_m / z) / (z - t);
else
tmp = (x_m / t) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -5.8e-22], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-100], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{-22}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-100}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -5.8000000000000003e-22Initial program 90.4%
Taylor expanded in y around inf 84.8%
associate-/r*89.9%
Simplified89.9%
if -5.8000000000000003e-22 < y < 2.10000000000000009e-100Initial program 93.9%
Taylor expanded in y around 0 76.8%
mul-1-neg76.8%
associate-/r*77.7%
distribute-neg-frac277.7%
sub-neg77.7%
+-commutative77.7%
distribute-neg-in77.7%
remove-double-neg77.7%
unsub-neg77.7%
Simplified77.7%
if 2.10000000000000009e-100 < y Initial program 78.9%
associate-/l/98.5%
Simplified98.5%
Taylor expanded in t around inf 61.3%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -1.25e-23)
(/ (/ x_m y) (- t z))
(if (<= y 4.6e-256) (/ x_m (* z (- z t))) (/ (/ x_m t) (- y z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -1.25e-23) {
tmp = (x_m / y) / (t - z);
} else if (y <= 4.6e-256) {
tmp = x_m / (z * (z - t));
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.25d-23)) then
tmp = (x_m / y) / (t - z)
else if (y <= 4.6d-256) then
tmp = x_m / (z * (z - t))
else
tmp = (x_m / t) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -1.25e-23) {
tmp = (x_m / y) / (t - z);
} else if (y <= 4.6e-256) {
tmp = x_m / (z * (z - t));
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -1.25e-23: tmp = (x_m / y) / (t - z) elif y <= 4.6e-256: tmp = x_m / (z * (z - t)) else: tmp = (x_m / t) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -1.25e-23) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= 4.6e-256) tmp = Float64(x_m / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x_m / t) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (y <= -1.25e-23)
tmp = (x_m / y) / (t - z);
elseif (y <= 4.6e-256)
tmp = x_m / (z * (z - t));
else
tmp = (x_m / t) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -1.25e-23], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e-256], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-23}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{-256}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.2500000000000001e-23Initial program 90.4%
Taylor expanded in y around inf 84.8%
associate-/r*89.9%
Simplified89.9%
if -1.2500000000000001e-23 < y < 4.6e-256Initial program 93.9%
Taylor expanded in y around 0 82.1%
mul-1-neg82.1%
distribute-rgt-neg-in82.1%
sub-neg82.1%
+-commutative82.1%
distribute-neg-in82.1%
remove-double-neg82.1%
unsub-neg82.1%
Simplified82.1%
if 4.6e-256 < y Initial program 83.2%
associate-/l/97.3%
Simplified97.3%
Taylor expanded in t around inf 59.8%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -98000000.0) (not (<= z 9.2e+21)))
(/ (/ x_m z) z)
(/ (/ x_m y) t))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -98000000.0) || !(z <= 9.2e+21)) {
tmp = (x_m / z) / z;
} else {
tmp = (x_m / y) / t;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-98000000.0d0)) .or. (.not. (z <= 9.2d+21))) then
tmp = (x_m / z) / z
else
tmp = (x_m / y) / t
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -98000000.0) || !(z <= 9.2e+21)) {
tmp = (x_m / z) / z;
} else {
tmp = (x_m / y) / t;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -98000000.0) or not (z <= 9.2e+21): tmp = (x_m / z) / z else: tmp = (x_m / y) / t return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -98000000.0) || !(z <= 9.2e+21)) tmp = Float64(Float64(x_m / z) / z); else tmp = Float64(Float64(x_m / y) / t); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -98000000.0) || ~((z <= 9.2e+21)))
tmp = (x_m / z) / z;
else
tmp = (x_m / y) / t;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -98000000.0], N[Not[LessEqual[z, 9.2e+21]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -98000000 \lor \neg \left(z \leq 9.2 \cdot 10^{+21}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\end{array}
\end{array}
if z < -9.8e7 or 9.2e21 < z Initial program 86.0%
Taylor expanded in t around 0 80.3%
mul-1-neg80.3%
associate-/r*90.7%
distribute-neg-frac290.7%
neg-sub090.7%
sub-neg90.7%
+-commutative90.7%
associate--r+90.7%
neg-sub090.7%
remove-double-neg90.7%
Simplified90.7%
Taylor expanded in z around inf 79.2%
if -9.8e7 < z < 9.2e21Initial program 89.9%
Taylor expanded in y around inf 63.0%
associate-/r*68.4%
Simplified68.4%
Taylor expanded in t around inf 58.5%
Final simplification67.5%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -145000000.0) (not (<= z 3.8e+27)))
(/ x_m (* z z))
(/ (/ x_m y) t))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -145000000.0) || !(z <= 3.8e+27)) {
tmp = x_m / (z * z);
} else {
tmp = (x_m / y) / t;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-145000000.0d0)) .or. (.not. (z <= 3.8d+27))) then
tmp = x_m / (z * z)
else
tmp = (x_m / y) / t
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -145000000.0) || !(z <= 3.8e+27)) {
tmp = x_m / (z * z);
} else {
tmp = (x_m / y) / t;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -145000000.0) or not (z <= 3.8e+27): tmp = x_m / (z * z) else: tmp = (x_m / y) / t return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -145000000.0) || !(z <= 3.8e+27)) tmp = Float64(x_m / Float64(z * z)); else tmp = Float64(Float64(x_m / y) / t); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -145000000.0) || ~((z <= 3.8e+27)))
tmp = x_m / (z * z);
else
tmp = (x_m / y) / t;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -145000000.0], N[Not[LessEqual[z, 3.8e+27]], $MachinePrecision]], N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -145000000 \lor \neg \left(z \leq 3.8 \cdot 10^{+27}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\end{array}
\end{array}
if z < -1.45e8 or 3.80000000000000022e27 < z Initial program 86.0%
Taylor expanded in t around 0 80.3%
mul-1-neg80.3%
distribute-rgt-neg-in80.3%
neg-sub080.3%
sub-neg80.3%
+-commutative80.3%
associate--r+80.3%
neg-sub080.3%
remove-double-neg80.3%
Simplified80.3%
Taylor expanded in z around inf 70.5%
if -1.45e8 < z < 3.80000000000000022e27Initial program 89.9%
Taylor expanded in y around inf 63.0%
associate-/r*68.4%
Simplified68.4%
Taylor expanded in t around inf 58.5%
Final simplification63.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -106000000.0) (not (<= z 1.05e+23)))
(/ x_m (* z z))
(/ (/ x_m t) y))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -106000000.0) || !(z <= 1.05e+23)) {
tmp = x_m / (z * z);
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-106000000.0d0)) .or. (.not. (z <= 1.05d+23))) then
tmp = x_m / (z * z)
else
tmp = (x_m / t) / y
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -106000000.0) || !(z <= 1.05e+23)) {
tmp = x_m / (z * z);
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -106000000.0) or not (z <= 1.05e+23): tmp = x_m / (z * z) else: tmp = (x_m / t) / y return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -106000000.0) || !(z <= 1.05e+23)) tmp = Float64(x_m / Float64(z * z)); else tmp = Float64(Float64(x_m / t) / y); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -106000000.0) || ~((z <= 1.05e+23)))
tmp = x_m / (z * z);
else
tmp = (x_m / t) / y;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -106000000.0], N[Not[LessEqual[z, 1.05e+23]], $MachinePrecision]], N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -106000000 \lor \neg \left(z \leq 1.05 \cdot 10^{+23}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if z < -1.06e8 or 1.0500000000000001e23 < z Initial program 86.0%
Taylor expanded in t around 0 80.3%
mul-1-neg80.3%
distribute-rgt-neg-in80.3%
neg-sub080.3%
sub-neg80.3%
+-commutative80.3%
associate--r+80.3%
neg-sub080.3%
remove-double-neg80.3%
Simplified80.3%
Taylor expanded in z around inf 70.5%
if -1.06e8 < z < 1.0500000000000001e23Initial program 89.9%
associate-/l/95.9%
clear-num95.9%
inv-pow95.9%
div-inv95.8%
clear-num95.9%
Applied egg-rr95.9%
unpow-195.9%
Simplified95.9%
Taylor expanded in z around 0 53.4%
associate-/r*60.7%
Simplified60.7%
Final simplification65.0%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -100000000.0) (not (<= z 2.05e-38)))
(/ x_m (* z z))
(/ x_m (* y t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -100000000.0) || !(z <= 2.05e-38)) {
tmp = x_m / (z * z);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-100000000.0d0)) .or. (.not. (z <= 2.05d-38))) then
tmp = x_m / (z * z)
else
tmp = x_m / (y * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -100000000.0) || !(z <= 2.05e-38)) {
tmp = x_m / (z * z);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -100000000.0) or not (z <= 2.05e-38): tmp = x_m / (z * z) else: tmp = x_m / (y * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -100000000.0) || !(z <= 2.05e-38)) tmp = Float64(x_m / Float64(z * z)); else tmp = Float64(x_m / Float64(y * t)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -100000000.0) || ~((z <= 2.05e-38)))
tmp = x_m / (z * z);
else
tmp = x_m / (y * t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -100000000.0], N[Not[LessEqual[z, 2.05e-38]], $MachinePrecision]], N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -100000000 \lor \neg \left(z \leq 2.05 \cdot 10^{-38}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -1e8 or 2.0499999999999999e-38 < z Initial program 87.3%
Taylor expanded in t around 0 76.9%
mul-1-neg76.9%
distribute-rgt-neg-in76.9%
neg-sub076.9%
sub-neg76.9%
+-commutative76.9%
associate--r+76.9%
neg-sub076.9%
remove-double-neg76.9%
Simplified76.9%
Taylor expanded in z around inf 65.1%
if -1e8 < z < 2.0499999999999999e-38Initial program 89.2%
Taylor expanded in z around 0 57.7%
Final simplification61.5%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -150000000.0) (not (<= z 2.4e+90)))
(/ x_m (* y z))
(/ x_m (* y t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -150000000.0) || !(z <= 2.4e+90)) {
tmp = x_m / (y * z);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-150000000.0d0)) .or. (.not. (z <= 2.4d+90))) then
tmp = x_m / (y * z)
else
tmp = x_m / (y * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -150000000.0) || !(z <= 2.4e+90)) {
tmp = x_m / (y * z);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -150000000.0) or not (z <= 2.4e+90): tmp = x_m / (y * z) else: tmp = x_m / (y * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -150000000.0) || !(z <= 2.4e+90)) tmp = Float64(x_m / Float64(y * z)); else tmp = Float64(x_m / Float64(y * t)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -150000000.0) || ~((z <= 2.4e+90)))
tmp = x_m / (y * z);
else
tmp = x_m / (y * t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -150000000.0], N[Not[LessEqual[z, 2.4e+90]], $MachinePrecision]], N[(x$95$m / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -150000000 \lor \neg \left(z \leq 2.4 \cdot 10^{+90}\right):\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.5e8 or 2.4000000000000001e90 < z Initial program 85.6%
Taylor expanded in t around 0 81.3%
mul-1-neg81.3%
associate-/r*92.7%
distribute-neg-frac292.7%
neg-sub092.7%
sub-neg92.7%
+-commutative92.7%
associate--r+92.7%
neg-sub092.7%
remove-double-neg92.7%
Simplified92.7%
Taylor expanded in z around 0 49.3%
neg-mul-149.3%
Simplified49.3%
div-inv49.3%
associate-/l*37.5%
add-sqr-sqrt23.5%
sqrt-unprod32.8%
sqr-neg32.8%
sqrt-unprod11.5%
add-sqr-sqrt32.4%
Applied egg-rr32.4%
associate-/l/32.4%
associate-*r/32.4%
associate-*l/32.4%
*-rgt-identity32.4%
*-commutative32.4%
Simplified32.4%
if -1.5e8 < z < 2.4000000000000001e90Initial program 89.9%
Taylor expanded in z around 0 50.5%
Final simplification43.4%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t 8.4e+168)
(/ x_m (* (- y z) (- t z)))
(/ (/ 1.0 t) (/ (- y z) x_m)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 8.4e+168) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (1.0 / t) / ((y - z) / x_m);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 8.4d+168) then
tmp = x_m / ((y - z) * (t - z))
else
tmp = (1.0d0 / t) / ((y - z) / x_m)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 8.4e+168) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (1.0 / t) / ((y - z) / x_m);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if t <= 8.4e+168: tmp = x_m / ((y - z) * (t - z)) else: tmp = (1.0 / t) / ((y - z) / x_m) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= 8.4e+168) tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(Float64(1.0 / t) / Float64(Float64(y - z) / x_m)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (t <= 8.4e+168)
tmp = x_m / ((y - z) * (t - z));
else
tmp = (1.0 / t) / ((y - z) / x_m);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, 8.4e+168], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t), $MachinePrecision] / N[(N[(y - z), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq 8.4 \cdot 10^{+168}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{t}}{\frac{y - z}{x\_m}}\\
\end{array}
\end{array}
if t < 8.40000000000000011e168Initial program 90.3%
if 8.40000000000000011e168 < t Initial program 69.4%
associate-/r*96.0%
div-inv95.9%
Applied egg-rr95.9%
Taylor expanded in t around inf 95.9%
*-commutative95.9%
clear-num95.9%
un-div-inv95.9%
Applied egg-rr95.9%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t 2.35e+166)
(/ x_m (* (- y z) (- t z)))
(* (/ 1.0 t) (/ x_m (- y z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 2.35e+166) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (1.0 / t) * (x_m / (y - z));
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 2.35d+166) then
tmp = x_m / ((y - z) * (t - z))
else
tmp = (1.0d0 / t) * (x_m / (y - z))
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 2.35e+166) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (1.0 / t) * (x_m / (y - z));
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if t <= 2.35e+166: tmp = x_m / ((y - z) * (t - z)) else: tmp = (1.0 / t) * (x_m / (y - z)) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= 2.35e+166) tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(Float64(1.0 / t) * Float64(x_m / Float64(y - z))); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (t <= 2.35e+166)
tmp = x_m / ((y - z) * (t - z));
else
tmp = (1.0 / t) * (x_m / (y - z));
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, 2.35e+166], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t), $MachinePrecision] * N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq 2.35 \cdot 10^{+166}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t} \cdot \frac{x\_m}{y - z}\\
\end{array}
\end{array}
if t < 2.35e166Initial program 90.3%
if 2.35e166 < t Initial program 69.4%
associate-/r*96.0%
div-inv95.9%
Applied egg-rr95.9%
Taylor expanded in t around inf 95.9%
Final simplification90.8%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x_s x_m y z t) :precision binary64 (* x_s (/ x_m (* y t))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m / (y * t));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x_s * (x_m / (y * t))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m / (y * t));
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): return x_s * (x_m / (y * t))
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(x_m / Float64(y * t))) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp = code(x_s, x_m, y, z, t)
tmp = x_s * (x_m / (y * t));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \frac{x\_m}{y \cdot t}
\end{array}
Initial program 88.2%
Taylor expanded in z around 0 39.0%
Final simplification39.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t z)))) (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / 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 = (y - z) * (t - z)
if ((x / t_1) < 0.0d0) then
tmp = (x / (y - z)) / (t - z)
else
tmp = x * (1.0d0 / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if (x / t_1) < 0.0: tmp = (x / (y - z)) / (t - z) else: tmp = x * (1.0 / t_1) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (Float64(x / t_1) < 0.0) tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); else tmp = Float64(x * Float64(1.0 / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - z); tmp = 0.0; if ((x / t_1) < 0.0) tmp = (x / (y - z)) / (t - z); else tmp = x * (1.0 / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;\frac{x}{t\_1} < 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024110
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:alt
(if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))
(/ x (* (- y z) (- t z))))