
(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 21 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
(*
x_s
(if (<= x_m 1e-47)
(/ x_m (* (- y z) (- t z)))
(/ (* x_m (/ -1.0 (- y z))) (- z 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 (x_m <= 1e-47) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (x_m * (-1.0 / (y - z))) / (z - 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 (x_m <= 1d-47) then
tmp = x_m / ((y - z) * (t - z))
else
tmp = (x_m * ((-1.0d0) / (y - z))) / (z - 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 (x_m <= 1e-47) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (x_m * (-1.0 / (y - z))) / (z - 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 x_m <= 1e-47: tmp = x_m / ((y - z) * (t - z)) else: tmp = (x_m * (-1.0 / (y - z))) / (z - 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 (x_m <= 1e-47) tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(Float64(x_m * Float64(-1.0 / Float64(y - z))) / Float64(z - 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 (x_m <= 1e-47)
tmp = x_m / ((y - z) * (t - z));
else
tmp = (x_m * (-1.0 / (y - z))) / (z - 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[LessEqual[x$95$m, 1e-47], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m * N[(-1.0 / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z - 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}\;x\_m \leq 10^{-47}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m \cdot \frac{-1}{y - z}}{z - t}\\
\end{array}
\end{array}
if x < 9.9999999999999997e-48Initial program 92.6%
if 9.9999999999999997e-48 < x Initial program 77.9%
associate-/l/99.8%
div-inv99.7%
Applied egg-rr99.7%
clear-num99.6%
*-commutative99.6%
clear-num99.7%
frac-2neg99.7%
associate-*r/93.8%
Applied egg-rr93.8%
Final simplification93.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 (* z (- z t)))) (t_2 (/ (/ x_m z) z)))
(*
x_s
(if (<= z -1.15e+154)
t_2
(if (<= z -1.42e-152)
t_1
(if (<= z 3.9e-178)
(/ (/ 1.0 (/ t x_m)) y)
(if (<= z 1.85e+166) t_1 t_2)))))))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 t_2 = (x_m / z) / z;
double tmp;
if (z <= -1.15e+154) {
tmp = t_2;
} else if (z <= -1.42e-152) {
tmp = t_1;
} else if (z <= 3.9e-178) {
tmp = (1.0 / (t / x_m)) / y;
} else if (z <= 1.85e+166) {
tmp = t_1;
} else {
tmp = t_2;
}
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 / (z * (z - t))
t_2 = (x_m / z) / z
if (z <= (-1.15d+154)) then
tmp = t_2
else if (z <= (-1.42d-152)) then
tmp = t_1
else if (z <= 3.9d-178) then
tmp = (1.0d0 / (t / x_m)) / y
else if (z <= 1.85d+166) then
tmp = t_1
else
tmp = t_2
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 t_2 = (x_m / z) / z;
double tmp;
if (z <= -1.15e+154) {
tmp = t_2;
} else if (z <= -1.42e-152) {
tmp = t_1;
} else if (z <= 3.9e-178) {
tmp = (1.0 / (t / x_m)) / y;
} else if (z <= 1.85e+166) {
tmp = t_1;
} else {
tmp = t_2;
}
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)) t_2 = (x_m / z) / z tmp = 0 if z <= -1.15e+154: tmp = t_2 elif z <= -1.42e-152: tmp = t_1 elif z <= 3.9e-178: tmp = (1.0 / (t / x_m)) / y elif z <= 1.85e+166: tmp = t_1 else: tmp = t_2 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))) t_2 = Float64(Float64(x_m / z) / z) tmp = 0.0 if (z <= -1.15e+154) tmp = t_2; elseif (z <= -1.42e-152) tmp = t_1; elseif (z <= 3.9e-178) tmp = Float64(Float64(1.0 / Float64(t / x_m)) / y); elseif (z <= 1.85e+166) tmp = t_1; else tmp = t_2; 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));
t_2 = (x_m / z) / z;
tmp = 0.0;
if (z <= -1.15e+154)
tmp = t_2;
elseif (z <= -1.42e-152)
tmp = t_1;
elseif (z <= 3.9e-178)
tmp = (1.0 / (t / x_m)) / y;
elseif (z <= 1.85e+166)
tmp = t_1;
else
tmp = t_2;
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]}, Block[{t$95$2 = N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.15e+154], t$95$2, If[LessEqual[z, -1.42e-152], t$95$1, If[LessEqual[z, 3.9e-178], N[(N[(1.0 / N[(t / x$95$m), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1.85e+166], t$95$1, t$95$2]]]]), $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)}\\
t_2 := \frac{\frac{x\_m}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+154}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.42 \cdot 10^{-152}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-178}:\\
\;\;\;\;\frac{\frac{1}{\frac{t}{x\_m}}}{y}\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+166}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if z < -1.15e154 or 1.85000000000000011e166 < z Initial program 69.6%
Taylor expanded in t around 0 69.6%
mul-1-neg69.6%
associate-/r*94.0%
distribute-neg-frac294.0%
neg-sub094.0%
sub-neg94.0%
+-commutative94.0%
associate--r+94.0%
neg-sub094.0%
remove-double-neg94.0%
Simplified94.0%
Taylor expanded in z around inf 93.7%
if -1.15e154 < z < -1.42e-152 or 3.90000000000000025e-178 < z < 1.85000000000000011e166Initial program 91.8%
Taylor expanded in y around 0 62.9%
mul-1-neg62.9%
distribute-rgt-neg-in62.9%
sub-neg62.9%
+-commutative62.9%
distribute-neg-in62.9%
remove-double-neg62.9%
unsub-neg62.9%
Simplified62.9%
if -1.42e-152 < z < 3.90000000000000025e-178Initial program 96.3%
associate-/l/92.0%
Simplified92.0%
Taylor expanded in t around inf 90.3%
Taylor expanded in y around inf 83.7%
clear-num83.7%
inv-pow83.7%
Applied egg-rr83.7%
unpow-183.7%
Simplified83.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
(let* ((t_1 (/ x_m (* z (- z t)))) (t_2 (/ (/ x_m z) z)))
(*
x_s
(if (<= z -6.6e+152)
t_2
(if (<= z -6.4e-153)
t_1
(if (<= z 4.5e-175) (/ (/ x_m t) y) (if (<= z 1.3e+166) t_1 t_2)))))))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 t_2 = (x_m / z) / z;
double tmp;
if (z <= -6.6e+152) {
tmp = t_2;
} else if (z <= -6.4e-153) {
tmp = t_1;
} else if (z <= 4.5e-175) {
tmp = (x_m / t) / y;
} else if (z <= 1.3e+166) {
tmp = t_1;
} else {
tmp = t_2;
}
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 / (z * (z - t))
t_2 = (x_m / z) / z
if (z <= (-6.6d+152)) then
tmp = t_2
else if (z <= (-6.4d-153)) then
tmp = t_1
else if (z <= 4.5d-175) then
tmp = (x_m / t) / y
else if (z <= 1.3d+166) then
tmp = t_1
else
tmp = t_2
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 t_2 = (x_m / z) / z;
double tmp;
if (z <= -6.6e+152) {
tmp = t_2;
} else if (z <= -6.4e-153) {
tmp = t_1;
} else if (z <= 4.5e-175) {
tmp = (x_m / t) / y;
} else if (z <= 1.3e+166) {
tmp = t_1;
} else {
tmp = t_2;
}
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)) t_2 = (x_m / z) / z tmp = 0 if z <= -6.6e+152: tmp = t_2 elif z <= -6.4e-153: tmp = t_1 elif z <= 4.5e-175: tmp = (x_m / t) / y elif z <= 1.3e+166: tmp = t_1 else: tmp = t_2 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))) t_2 = Float64(Float64(x_m / z) / z) tmp = 0.0 if (z <= -6.6e+152) tmp = t_2; elseif (z <= -6.4e-153) tmp = t_1; elseif (z <= 4.5e-175) tmp = Float64(Float64(x_m / t) / y); elseif (z <= 1.3e+166) tmp = t_1; else tmp = t_2; 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));
t_2 = (x_m / z) / z;
tmp = 0.0;
if (z <= -6.6e+152)
tmp = t_2;
elseif (z <= -6.4e-153)
tmp = t_1;
elseif (z <= 4.5e-175)
tmp = (x_m / t) / y;
elseif (z <= 1.3e+166)
tmp = t_1;
else
tmp = t_2;
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]}, Block[{t$95$2 = N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -6.6e+152], t$95$2, If[LessEqual[z, -6.4e-153], t$95$1, If[LessEqual[z, 4.5e-175], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1.3e+166], t$95$1, t$95$2]]]]), $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)}\\
t_2 := \frac{\frac{x\_m}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+152}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -6.4 \cdot 10^{-153}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-175}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+166}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if z < -6.6000000000000003e152 or 1.3e166 < z Initial program 69.6%
Taylor expanded in t around 0 69.6%
mul-1-neg69.6%
associate-/r*94.0%
distribute-neg-frac294.0%
neg-sub094.0%
sub-neg94.0%
+-commutative94.0%
associate--r+94.0%
neg-sub094.0%
remove-double-neg94.0%
Simplified94.0%
Taylor expanded in z around inf 93.7%
if -6.6000000000000003e152 < z < -6.3999999999999998e-153 or 4.49999999999999998e-175 < z < 1.3e166Initial program 91.8%
Taylor expanded in y around 0 62.9%
mul-1-neg62.9%
distribute-rgt-neg-in62.9%
sub-neg62.9%
+-commutative62.9%
distribute-neg-in62.9%
remove-double-neg62.9%
unsub-neg62.9%
Simplified62.9%
if -6.3999999999999998e-153 < z < 4.49999999999999998e-175Initial program 96.3%
associate-/l/92.0%
Simplified92.0%
Taylor expanded in t around inf 90.3%
Taylor expanded in y around inf 83.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
(let* ((t_1 (/ (/ x_m z) (- t))))
(*
x_s
(if (<= z -1.4e-9)
(* (/ x_m z) (/ 1.0 z))
(if (<= z -4.7e-67)
t_1
(if (<= z 1e+46)
(/ (/ x_m t) y)
(if (<= z 8.6e+115) t_1 (/ (/ x_m z) 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) / -t;
double tmp;
if (z <= -1.4e-9) {
tmp = (x_m / z) * (1.0 / z);
} else if (z <= -4.7e-67) {
tmp = t_1;
} else if (z <= 1e+46) {
tmp = (x_m / t) / y;
} else if (z <= 8.6e+115) {
tmp = t_1;
} else {
tmp = (x_m / z) / 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) / -t
if (z <= (-1.4d-9)) then
tmp = (x_m / z) * (1.0d0 / z)
else if (z <= (-4.7d-67)) then
tmp = t_1
else if (z <= 1d+46) then
tmp = (x_m / t) / y
else if (z <= 8.6d+115) then
tmp = t_1
else
tmp = (x_m / z) / 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) / -t;
double tmp;
if (z <= -1.4e-9) {
tmp = (x_m / z) * (1.0 / z);
} else if (z <= -4.7e-67) {
tmp = t_1;
} else if (z <= 1e+46) {
tmp = (x_m / t) / y;
} else if (z <= 8.6e+115) {
tmp = t_1;
} else {
tmp = (x_m / z) / 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) / -t tmp = 0 if z <= -1.4e-9: tmp = (x_m / z) * (1.0 / z) elif z <= -4.7e-67: tmp = t_1 elif z <= 1e+46: tmp = (x_m / t) / y elif z <= 8.6e+115: tmp = t_1 else: tmp = (x_m / z) / 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 / z) / Float64(-t)) tmp = 0.0 if (z <= -1.4e-9) tmp = Float64(Float64(x_m / z) * Float64(1.0 / z)); elseif (z <= -4.7e-67) tmp = t_1; elseif (z <= 1e+46) tmp = Float64(Float64(x_m / t) / y); elseif (z <= 8.6e+115) tmp = t_1; else tmp = Float64(Float64(x_m / z) / 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) / -t;
tmp = 0.0;
if (z <= -1.4e-9)
tmp = (x_m / z) * (1.0 / z);
elseif (z <= -4.7e-67)
tmp = t_1;
elseif (z <= 1e+46)
tmp = (x_m / t) / y;
elseif (z <= 8.6e+115)
tmp = t_1;
else
tmp = (x_m / z) / 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 / z), $MachinePrecision] / (-t)), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.4e-9], N[(N[(x$95$m / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.7e-67], t$95$1, If[LessEqual[z, 1e+46], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 8.6e+115], t$95$1, N[(N[(x$95$m / z), $MachinePrecision] / z), $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}{z}}{-t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{-9}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{+46}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z}\\
\end{array}
\end{array}
\end{array}
if z < -1.39999999999999992e-9Initial program 81.2%
Taylor expanded in t around 0 75.6%
mul-1-neg75.6%
associate-/r*87.2%
distribute-neg-frac287.2%
neg-sub087.2%
sub-neg87.2%
+-commutative87.2%
associate--r+87.2%
neg-sub087.2%
remove-double-neg87.2%
Simplified87.2%
div-inv87.2%
Applied egg-rr87.2%
Taylor expanded in z around inf 78.0%
if -1.39999999999999992e-9 < z < -4.70000000000000004e-67 or 9.9999999999999999e45 < z < 8.5999999999999993e115Initial program 89.8%
associate-/l/99.7%
div-inv99.6%
Applied egg-rr99.6%
clear-num99.6%
*-commutative99.6%
clear-num99.6%
frac-2neg99.6%
associate-*r/97.1%
Applied egg-rr97.1%
Taylor expanded in t around inf 62.0%
neg-mul-162.0%
Simplified62.0%
Taylor expanded in y around 0 49.1%
if -4.70000000000000004e-67 < z < 9.9999999999999999e45Initial program 95.4%
associate-/l/94.8%
Simplified94.8%
Taylor expanded in t around inf 77.1%
Taylor expanded in y around inf 63.1%
if 8.5999999999999993e115 < z Initial program 77.3%
Taylor expanded in t around 0 77.3%
mul-1-neg77.3%
associate-/r*94.3%
distribute-neg-frac294.3%
neg-sub094.3%
sub-neg94.3%
+-commutative94.3%
associate--r+94.3%
neg-sub094.3%
remove-double-neg94.3%
Simplified94.3%
Taylor expanded in z around inf 88.6%
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) (- t))) (t_2 (/ (/ x_m z) z)))
(*
x_s
(if (<= z -3e-7)
t_2
(if (<= z -5.6e-67)
t_1
(if (<= z 8.2e+45) (/ (/ x_m t) y) (if (<= z 1.95e+115) t_1 t_2)))))))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) / -t;
double t_2 = (x_m / z) / z;
double tmp;
if (z <= -3e-7) {
tmp = t_2;
} else if (z <= -5.6e-67) {
tmp = t_1;
} else if (z <= 8.2e+45) {
tmp = (x_m / t) / y;
} else if (z <= 1.95e+115) {
tmp = t_1;
} else {
tmp = t_2;
}
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 / z) / -t
t_2 = (x_m / z) / z
if (z <= (-3d-7)) then
tmp = t_2
else if (z <= (-5.6d-67)) then
tmp = t_1
else if (z <= 8.2d+45) then
tmp = (x_m / t) / y
else if (z <= 1.95d+115) then
tmp = t_1
else
tmp = t_2
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) / -t;
double t_2 = (x_m / z) / z;
double tmp;
if (z <= -3e-7) {
tmp = t_2;
} else if (z <= -5.6e-67) {
tmp = t_1;
} else if (z <= 8.2e+45) {
tmp = (x_m / t) / y;
} else if (z <= 1.95e+115) {
tmp = t_1;
} else {
tmp = t_2;
}
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) / -t t_2 = (x_m / z) / z tmp = 0 if z <= -3e-7: tmp = t_2 elif z <= -5.6e-67: tmp = t_1 elif z <= 8.2e+45: tmp = (x_m / t) / y elif z <= 1.95e+115: tmp = t_1 else: tmp = t_2 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 / z) / Float64(-t)) t_2 = Float64(Float64(x_m / z) / z) tmp = 0.0 if (z <= -3e-7) tmp = t_2; elseif (z <= -5.6e-67) tmp = t_1; elseif (z <= 8.2e+45) tmp = Float64(Float64(x_m / t) / y); elseif (z <= 1.95e+115) tmp = t_1; else tmp = t_2; 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) / -t;
t_2 = (x_m / z) / z;
tmp = 0.0;
if (z <= -3e-7)
tmp = t_2;
elseif (z <= -5.6e-67)
tmp = t_1;
elseif (z <= 8.2e+45)
tmp = (x_m / t) / y;
elseif (z <= 1.95e+115)
tmp = t_1;
else
tmp = t_2;
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 / z), $MachinePrecision] / (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -3e-7], t$95$2, If[LessEqual[z, -5.6e-67], t$95$1, If[LessEqual[z, 8.2e+45], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1.95e+115], t$95$1, t$95$2]]]]), $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}{z}}{-t}\\
t_2 := \frac{\frac{x\_m}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-7}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+45}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if z < -2.9999999999999999e-7 or 1.95000000000000003e115 < z Initial program 79.8%
Taylor expanded in t around 0 76.3%
mul-1-neg76.3%
associate-/r*89.9%
distribute-neg-frac289.9%
neg-sub089.9%
sub-neg89.9%
+-commutative89.9%
associate--r+89.9%
neg-sub089.9%
remove-double-neg89.9%
Simplified89.9%
Taylor expanded in z around inf 82.0%
if -2.9999999999999999e-7 < z < -5.60000000000000021e-67 or 8.20000000000000025e45 < z < 1.95000000000000003e115Initial program 89.8%
associate-/l/99.7%
div-inv99.6%
Applied egg-rr99.6%
clear-num99.6%
*-commutative99.6%
clear-num99.6%
frac-2neg99.6%
associate-*r/97.1%
Applied egg-rr97.1%
Taylor expanded in t around inf 62.0%
neg-mul-162.0%
Simplified62.0%
Taylor expanded in y around 0 49.1%
if -5.60000000000000021e-67 < z < 8.20000000000000025e45Initial program 95.4%
associate-/l/94.8%
Simplified94.8%
Taylor expanded in t around inf 77.1%
Taylor expanded in y around inf 63.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 (* (- y z) (- t z))))) (* x_s (if (<= t_1 0.0) (/ (/ x_m (- t z)) (- y z)) t_1))))
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 <= 0.0) {
tmp = (x_m / (t - z)) / (y - z);
} else {
tmp = t_1;
}
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 <= 0.0d0) then
tmp = (x_m / (t - z)) / (y - z)
else
tmp = t_1
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 <= 0.0) {
tmp = (x_m / (t - z)) / (y - z);
} else {
tmp = t_1;
}
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 <= 0.0: tmp = (x_m / (t - z)) / (y - z) else: tmp = t_1 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 <= 0.0) tmp = Float64(Float64(x_m / Float64(t - z)) / Float64(y - z)); else tmp = t_1; 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 <= 0.0)
tmp = (x_m / (t - z)) / (y - z);
else
tmp = t_1;
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, 0.0], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], t$95$1]), $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 0:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -0.0Initial program 84.4%
associate-/l/98.9%
Simplified98.9%
if -0.0 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 99.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
(let* ((t_1 (/ (/ x_m z) z)))
(*
x_s
(if (<= z -3.5e-8)
t_1
(if (<= z -4.8e-67)
(/ x_m (* z (- t)))
(if (<= z 3.1e+31) (/ (/ x_m t) y) t_1))))))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;
double tmp;
if (z <= -3.5e-8) {
tmp = t_1;
} else if (z <= -4.8e-67) {
tmp = x_m / (z * -t);
} else if (z <= 3.1e+31) {
tmp = (x_m / t) / y;
} else {
tmp = t_1;
}
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
if (z <= (-3.5d-8)) then
tmp = t_1
else if (z <= (-4.8d-67)) then
tmp = x_m / (z * -t)
else if (z <= 3.1d+31) then
tmp = (x_m / t) / y
else
tmp = t_1
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;
double tmp;
if (z <= -3.5e-8) {
tmp = t_1;
} else if (z <= -4.8e-67) {
tmp = x_m / (z * -t);
} else if (z <= 3.1e+31) {
tmp = (x_m / t) / y;
} else {
tmp = t_1;
}
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 tmp = 0 if z <= -3.5e-8: tmp = t_1 elif z <= -4.8e-67: tmp = x_m / (z * -t) elif z <= 3.1e+31: tmp = (x_m / t) / y else: tmp = t_1 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 / z) / z) tmp = 0.0 if (z <= -3.5e-8) tmp = t_1; elseif (z <= -4.8e-67) tmp = Float64(x_m / Float64(z * Float64(-t))); elseif (z <= 3.1e+31) tmp = Float64(Float64(x_m / t) / y); else tmp = t_1; 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;
tmp = 0.0;
if (z <= -3.5e-8)
tmp = t_1;
elseif (z <= -4.8e-67)
tmp = x_m / (z * -t);
elseif (z <= 3.1e+31)
tmp = (x_m / t) / y;
else
tmp = t_1;
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 / z), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -3.5e-8], t$95$1, If[LessEqual[z, -4.8e-67], N[(x$95$m / N[(z * (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e+31], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]), $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}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-67}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(-t\right)}\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+31}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -3.50000000000000024e-8 or 3.1000000000000002e31 < z Initial program 81.5%
Taylor expanded in t around 0 72.7%
mul-1-neg72.7%
associate-/r*83.9%
distribute-neg-frac283.9%
neg-sub083.9%
sub-neg83.9%
+-commutative83.9%
associate--r+83.9%
neg-sub083.9%
remove-double-neg83.9%
Simplified83.9%
Taylor expanded in z around inf 74.2%
if -3.50000000000000024e-8 < z < -4.8e-67Initial program 99.4%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around inf 42.2%
Taylor expanded in y around 0 31.8%
associate-*r/31.8%
neg-mul-131.8%
Simplified31.8%
if -4.8e-67 < z < 3.1000000000000002e31Initial program 95.3%
associate-/l/94.7%
Simplified94.7%
Taylor expanded in t around inf 78.2%
Taylor expanded in y around inf 63.9%
Final simplification68.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 (<= z -2.2e+111)
(/ (/ x_m z) (- z y))
(if (<= z 7.8e+145)
(/ x_m (* (- y z) (- t z)))
(/ (/ -1.0 (- y z)) (/ 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 (z <= -2.2e+111) {
tmp = (x_m / z) / (z - y);
} else if (z <= 7.8e+145) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (-1.0 / (y - z)) / (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 (z <= (-2.2d+111)) then
tmp = (x_m / z) / (z - y)
else if (z <= 7.8d+145) then
tmp = x_m / ((y - z) * (t - z))
else
tmp = ((-1.0d0) / (y - z)) / (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 (z <= -2.2e+111) {
tmp = (x_m / z) / (z - y);
} else if (z <= 7.8e+145) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (-1.0 / (y - z)) / (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 z <= -2.2e+111: tmp = (x_m / z) / (z - y) elif z <= 7.8e+145: tmp = x_m / ((y - z) * (t - z)) else: tmp = (-1.0 / (y - z)) / (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 (z <= -2.2e+111) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (z <= 7.8e+145) tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(Float64(-1.0 / Float64(y - z)) / Float64(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 (z <= -2.2e+111)
tmp = (x_m / z) / (z - y);
elseif (z <= 7.8e+145)
tmp = x_m / ((y - z) * (t - z));
else
tmp = (-1.0 / (y - z)) / (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[z, -2.2e+111], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e+145], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(z / 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}\;z \leq -2.2 \cdot 10^{+111}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+145}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-1}{y - z}}{\frac{z}{x\_m}}\\
\end{array}
\end{array}
if z < -2.19999999999999999e111Initial program 71.5%
Taylor expanded in t around 0 71.4%
mul-1-neg71.4%
associate-/r*92.2%
distribute-neg-frac292.2%
neg-sub092.2%
sub-neg92.2%
+-commutative92.2%
associate--r+92.2%
neg-sub092.2%
remove-double-neg92.2%
Simplified92.2%
if -2.19999999999999999e111 < z < 7.7999999999999995e145Initial program 94.1%
if 7.7999999999999995e145 < z Initial program 73.5%
Taylor expanded in t around 0 73.5%
mul-1-neg73.5%
associate-/r*93.4%
distribute-neg-frac293.4%
neg-sub093.4%
sub-neg93.4%
+-commutative93.4%
associate--r+93.4%
neg-sub093.4%
remove-double-neg93.4%
Simplified93.4%
div-inv93.4%
Applied egg-rr93.4%
*-commutative93.4%
clear-num93.4%
un-div-inv93.5%
Applied egg-rr93.5%
Final simplification93.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 (<= z -3.2e+115)
(/ (/ x_m z) (- z y))
(if (<= z 4.8e+145)
(/ x_m (* (- y z) (- t z)))
(* (/ x_m z) (/ -1.0 (- 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 (z <= -3.2e+115) {
tmp = (x_m / z) / (z - y);
} else if (z <= 4.8e+145) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (x_m / z) * (-1.0 / (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 (z <= (-3.2d+115)) then
tmp = (x_m / z) / (z - y)
else if (z <= 4.8d+145) then
tmp = x_m / ((y - z) * (t - z))
else
tmp = (x_m / z) * ((-1.0d0) / (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 (z <= -3.2e+115) {
tmp = (x_m / z) / (z - y);
} else if (z <= 4.8e+145) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (x_m / z) * (-1.0 / (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 z <= -3.2e+115: tmp = (x_m / z) / (z - y) elif z <= 4.8e+145: tmp = x_m / ((y - z) * (t - z)) else: tmp = (x_m / z) * (-1.0 / (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 (z <= -3.2e+115) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (z <= 4.8e+145) tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(Float64(x_m / z) * Float64(-1.0 / 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 (z <= -3.2e+115)
tmp = (x_m / z) / (z - y);
elseif (z <= 4.8e+145)
tmp = x_m / ((y - z) * (t - z));
else
tmp = (x_m / z) * (-1.0 / (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[z, -3.2e+115], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e+145], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] * N[(-1.0 / 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}\;z \leq -3.2 \cdot 10^{+115}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+145}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{-1}{y - z}\\
\end{array}
\end{array}
if z < -3.2e115Initial program 71.5%
Taylor expanded in t around 0 71.4%
mul-1-neg71.4%
associate-/r*92.2%
distribute-neg-frac292.2%
neg-sub092.2%
sub-neg92.2%
+-commutative92.2%
associate--r+92.2%
neg-sub092.2%
remove-double-neg92.2%
Simplified92.2%
if -3.2e115 < z < 4.79999999999999984e145Initial program 94.1%
if 4.79999999999999984e145 < z Initial program 73.5%
Taylor expanded in t around 0 73.5%
mul-1-neg73.5%
associate-/r*93.4%
distribute-neg-frac293.4%
neg-sub093.4%
sub-neg93.4%
+-commutative93.4%
associate--r+93.4%
neg-sub093.4%
remove-double-neg93.4%
Simplified93.4%
div-inv93.4%
Applied egg-rr93.4%
Final simplification93.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 (<= t -1.24e-85)
(/ (/ x_m (- t z)) y)
(if (<= t 2.75e-18)
(* (/ x_m z) (/ -1.0 (- y z)))
(/ (/ 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 (t <= -1.24e-85) {
tmp = (x_m / (t - z)) / y;
} else if (t <= 2.75e-18) {
tmp = (x_m / z) * (-1.0 / (y - z));
} 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 (t <= (-1.24d-85)) then
tmp = (x_m / (t - z)) / y
else if (t <= 2.75d-18) then
tmp = (x_m / z) * ((-1.0d0) / (y - z))
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 (t <= -1.24e-85) {
tmp = (x_m / (t - z)) / y;
} else if (t <= 2.75e-18) {
tmp = (x_m / z) * (-1.0 / (y - z));
} 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 t <= -1.24e-85: tmp = (x_m / (t - z)) / y elif t <= 2.75e-18: tmp = (x_m / z) * (-1.0 / (y - z)) 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 (t <= -1.24e-85) tmp = Float64(Float64(x_m / Float64(t - z)) / y); elseif (t <= 2.75e-18) tmp = Float64(Float64(x_m / z) * Float64(-1.0 / Float64(y - z))); 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 (t <= -1.24e-85)
tmp = (x_m / (t - z)) / y;
elseif (t <= 2.75e-18)
tmp = (x_m / z) * (-1.0 / (y - z));
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[t, -1.24e-85], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 2.75e-18], N[(N[(x$95$m / z), $MachinePrecision] * N[(-1.0 / N[(y - z), $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}\;t \leq -1.24 \cdot 10^{-85}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\
\mathbf{elif}\;t \leq 2.75 \cdot 10^{-18}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{-1}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.23999999999999995e-85Initial program 83.1%
associate-/l/97.8%
Simplified97.8%
Taylor expanded in y around inf 70.2%
if -1.23999999999999995e-85 < t < 2.75e-18Initial program 92.4%
Taylor expanded in t around 0 79.6%
mul-1-neg79.6%
associate-/r*86.1%
distribute-neg-frac286.1%
neg-sub086.1%
sub-neg86.1%
+-commutative86.1%
associate--r+86.1%
neg-sub086.1%
remove-double-neg86.1%
Simplified86.1%
div-inv86.1%
Applied egg-rr86.1%
if 2.75e-18 < t Initial program 87.1%
associate-/l/95.8%
Simplified95.8%
Taylor expanded in t around inf 85.1%
Final simplification80.6%
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.5e-85)
(/ (/ x_m (- t z)) y)
(if (<= t 1.56e-18) (/ (/ x_m z) (- z y)) (/ (/ 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 (t <= -8.5e-85) {
tmp = (x_m / (t - z)) / y;
} else if (t <= 1.56e-18) {
tmp = (x_m / z) / (z - y);
} 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 (t <= (-8.5d-85)) then
tmp = (x_m / (t - z)) / y
else if (t <= 1.56d-18) then
tmp = (x_m / z) / (z - y)
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 (t <= -8.5e-85) {
tmp = (x_m / (t - z)) / y;
} else if (t <= 1.56e-18) {
tmp = (x_m / z) / (z - y);
} 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 t <= -8.5e-85: tmp = (x_m / (t - z)) / y elif t <= 1.56e-18: tmp = (x_m / z) / (z - y) 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 (t <= -8.5e-85) tmp = Float64(Float64(x_m / Float64(t - z)) / y); elseif (t <= 1.56e-18) tmp = Float64(Float64(x_m / z) / Float64(z - y)); 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 (t <= -8.5e-85)
tmp = (x_m / (t - z)) / y;
elseif (t <= 1.56e-18)
tmp = (x_m / z) / (z - y);
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[t, -8.5e-85], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 1.56e-18], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $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}\;t \leq -8.5 \cdot 10^{-85}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\
\mathbf{elif}\;t \leq 1.56 \cdot 10^{-18}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < -8.50000000000000052e-85Initial program 83.1%
associate-/l/97.8%
Simplified97.8%
Taylor expanded in y around inf 70.2%
if -8.50000000000000052e-85 < t < 1.55999999999999998e-18Initial program 92.4%
Taylor expanded in t around 0 79.6%
mul-1-neg79.6%
associate-/r*86.1%
distribute-neg-frac286.1%
neg-sub086.1%
sub-neg86.1%
+-commutative86.1%
associate--r+86.1%
neg-sub086.1%
remove-double-neg86.1%
Simplified86.1%
if 1.55999999999999998e-18 < t Initial program 87.1%
associate-/l/95.8%
Simplified95.8%
Taylor expanded in t around inf 85.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 (<= t -3.2e-82)
(/ (/ x_m y) (- t z))
(if (<= t 7.5e-19) (/ (/ x_m z) (- z y)) (/ (/ 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 (t <= -3.2e-82) {
tmp = (x_m / y) / (t - z);
} else if (t <= 7.5e-19) {
tmp = (x_m / z) / (z - y);
} 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 (t <= (-3.2d-82)) then
tmp = (x_m / y) / (t - z)
else if (t <= 7.5d-19) then
tmp = (x_m / z) / (z - y)
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 (t <= -3.2e-82) {
tmp = (x_m / y) / (t - z);
} else if (t <= 7.5e-19) {
tmp = (x_m / z) / (z - y);
} 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 t <= -3.2e-82: tmp = (x_m / y) / (t - z) elif t <= 7.5e-19: tmp = (x_m / z) / (z - y) 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 (t <= -3.2e-82) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (t <= 7.5e-19) tmp = Float64(Float64(x_m / z) / Float64(z - y)); 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 (t <= -3.2e-82)
tmp = (x_m / y) / (t - z);
elseif (t <= 7.5e-19)
tmp = (x_m / z) / (z - y);
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[t, -3.2e-82], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e-19], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $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}\;t \leq -3.2 \cdot 10^{-82}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < -3.2000000000000001e-82Initial program 82.9%
Taylor expanded in y around inf 56.7%
associate-/r*60.8%
Simplified60.8%
if -3.2000000000000001e-82 < t < 7.49999999999999957e-19Initial program 92.5%
Taylor expanded in t around 0 78.9%
mul-1-neg78.9%
associate-/r*85.3%
distribute-neg-frac285.3%
neg-sub085.3%
sub-neg85.3%
+-commutative85.3%
associate--r+85.3%
neg-sub085.3%
remove-double-neg85.3%
Simplified85.3%
if 7.49999999999999957e-19 < t Initial program 87.1%
associate-/l/95.8%
Simplified95.8%
Taylor expanded in t around inf 85.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 (<= y -6.4e+35)
(/ (/ x_m y) (- t z))
(if (<= y 2.7e-53) (/ (/ 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 <= -6.4e+35) {
tmp = (x_m / y) / (t - z);
} else if (y <= 2.7e-53) {
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 <= (-6.4d+35)) then
tmp = (x_m / y) / (t - z)
else if (y <= 2.7d-53) 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 <= -6.4e+35) {
tmp = (x_m / y) / (t - z);
} else if (y <= 2.7e-53) {
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 <= -6.4e+35: tmp = (x_m / y) / (t - z) elif y <= 2.7e-53: 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 <= -6.4e+35) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= 2.7e-53) 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 <= -6.4e+35)
tmp = (x_m / y) / (t - z);
elseif (y <= 2.7e-53)
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, -6.4e+35], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e-53], 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 -6.4 \cdot 10^{+35}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-53}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -6.39999999999999965e35Initial program 82.5%
Taylor expanded in y around inf 78.0%
associate-/r*79.5%
Simplified79.5%
if -6.39999999999999965e35 < y < 2.6999999999999999e-53Initial program 88.2%
Taylor expanded in y around 0 71.6%
mul-1-neg71.6%
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 2.6999999999999999e-53 < y Initial program 92.1%
associate-/l/98.5%
Simplified98.5%
Taylor expanded in t around inf 55.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 -8.2e-89)
(/ (/ x_m y) (- t z))
(if (<= t 6.8e-19) (/ x_m (* z (- z y))) (/ (/ 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 (t <= -8.2e-89) {
tmp = (x_m / y) / (t - z);
} else if (t <= 6.8e-19) {
tmp = x_m / (z * (z - y));
} 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 (t <= (-8.2d-89)) then
tmp = (x_m / y) / (t - z)
else if (t <= 6.8d-19) then
tmp = x_m / (z * (z - y))
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 (t <= -8.2e-89) {
tmp = (x_m / y) / (t - z);
} else if (t <= 6.8e-19) {
tmp = x_m / (z * (z - y));
} 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 t <= -8.2e-89: tmp = (x_m / y) / (t - z) elif t <= 6.8e-19: tmp = x_m / (z * (z - y)) 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 (t <= -8.2e-89) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (t <= 6.8e-19) tmp = Float64(x_m / Float64(z * Float64(z - y))); 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 (t <= -8.2e-89)
tmp = (x_m / y) / (t - z);
elseif (t <= 6.8e-19)
tmp = x_m / (z * (z - y));
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[t, -8.2e-89], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.8e-19], N[(x$95$m / N[(z * N[(z - y), $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}\;t \leq -8.2 \cdot 10^{-89}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{-19}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < -8.1999999999999997e-89Initial program 83.3%
Taylor expanded in y around inf 57.8%
associate-/r*61.7%
Simplified61.7%
if -8.1999999999999997e-89 < t < 6.8000000000000004e-19Initial program 92.3%
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%
if 6.8000000000000004e-19 < t Initial program 87.1%
associate-/l/95.8%
Simplified95.8%
Taylor expanded in t around inf 85.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 (<= t -4.2e-62)
(* (/ x_m t) (/ 1.0 y))
(if (<= t 3.2e-19) (/ x_m (* z (- z y))) (/ (/ 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 (t <= -4.2e-62) {
tmp = (x_m / t) * (1.0 / y);
} else if (t <= 3.2e-19) {
tmp = x_m / (z * (z - y));
} 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 (t <= (-4.2d-62)) then
tmp = (x_m / t) * (1.0d0 / y)
else if (t <= 3.2d-19) then
tmp = x_m / (z * (z - y))
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 (t <= -4.2e-62) {
tmp = (x_m / t) * (1.0 / y);
} else if (t <= 3.2e-19) {
tmp = x_m / (z * (z - y));
} 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 t <= -4.2e-62: tmp = (x_m / t) * (1.0 / y) elif t <= 3.2e-19: tmp = x_m / (z * (z - y)) 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 (t <= -4.2e-62) tmp = Float64(Float64(x_m / t) * Float64(1.0 / y)); elseif (t <= 3.2e-19) tmp = Float64(x_m / Float64(z * Float64(z - y))); 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 (t <= -4.2e-62)
tmp = (x_m / t) * (1.0 / y);
elseif (t <= 3.2e-19)
tmp = x_m / (z * (z - y));
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[t, -4.2e-62], N[(N[(x$95$m / t), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e-19], N[(x$95$m / N[(z * N[(z - y), $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}\;t \leq -4.2 \cdot 10^{-62}:\\
\;\;\;\;\frac{x\_m}{t} \cdot \frac{1}{y}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-19}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < -4.1999999999999998e-62Initial program 82.1%
Taylor expanded in z around 0 52.9%
associate-/r*65.1%
div-inv65.1%
Applied egg-rr65.1%
if -4.1999999999999998e-62 < t < 3.19999999999999982e-19Initial program 92.7%
Taylor expanded in t around 0 78.7%
mul-1-neg78.7%
distribute-rgt-neg-in78.7%
neg-sub078.7%
sub-neg78.7%
+-commutative78.7%
associate--r+78.7%
neg-sub078.7%
remove-double-neg78.7%
Simplified78.7%
if 3.19999999999999982e-19 < t Initial program 87.1%
associate-/l/95.8%
Simplified95.8%
Taylor expanded in t around inf 85.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 -2.8e-7) (not (<= z 3e+36))) (/ (/ 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 <= -2.8e-7) || !(z <= 3e+36)) {
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 <= (-2.8d-7)) .or. (.not. (z <= 3d+36))) 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 <= -2.8e-7) || !(z <= 3e+36)) {
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 <= -2.8e-7) or not (z <= 3e+36): 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 <= -2.8e-7) || !(z <= 3e+36)) tmp = Float64(Float64(x_m / 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 <= -2.8e-7) || ~((z <= 3e+36)))
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, -2.8e-7], N[Not[LessEqual[z, 3e+36]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / z), $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 -2.8 \cdot 10^{-7} \lor \neg \left(z \leq 3 \cdot 10^{+36}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if z < -2.80000000000000019e-7 or 3e36 < z Initial program 81.5%
Taylor expanded in t around 0 72.7%
mul-1-neg72.7%
associate-/r*83.9%
distribute-neg-frac283.9%
neg-sub083.9%
sub-neg83.9%
+-commutative83.9%
associate--r+83.9%
neg-sub083.9%
remove-double-neg83.9%
Simplified83.9%
Taylor expanded in z around inf 74.2%
if -2.80000000000000019e-7 < z < 3e36Initial program 95.6%
associate-/l/95.1%
Simplified95.1%
Taylor expanded in t around inf 75.1%
Taylor expanded in y around inf 60.4%
Final simplification68.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 -1.1e-10) (not (<= z 2.3e+35)))
(/ 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 <= -1.1e-10) || !(z <= 2.3e+35)) {
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 <= (-1.1d-10)) .or. (.not. (z <= 2.3d+35))) 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 <= -1.1e-10) || !(z <= 2.3e+35)) {
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 <= -1.1e-10) or not (z <= 2.3e+35): 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 <= -1.1e-10) || !(z <= 2.3e+35)) 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 <= -1.1e-10) || ~((z <= 2.3e+35)))
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, -1.1e-10], N[Not[LessEqual[z, 2.3e+35]], $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 -1.1 \cdot 10^{-10} \lor \neg \left(z \leq 2.3 \cdot 10^{+35}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if z < -1.09999999999999995e-10 or 2.2999999999999998e35 < z Initial program 81.5%
Taylor expanded in t around 0 72.7%
mul-1-neg72.7%
associate-/r*83.9%
distribute-neg-frac283.9%
neg-sub083.9%
sub-neg83.9%
+-commutative83.9%
associate--r+83.9%
neg-sub083.9%
remove-double-neg83.9%
Simplified83.9%
div-inv84.0%
Applied egg-rr84.0%
*-commutative84.0%
frac-times72.7%
*-un-lft-identity72.7%
Applied egg-rr72.7%
Taylor expanded in z around inf 65.1%
if -1.09999999999999995e-10 < z < 2.2999999999999998e35Initial program 95.6%
associate-/l/95.1%
Simplified95.1%
Taylor expanded in t around inf 75.1%
Taylor expanded in y around inf 60.4%
Final simplification63.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 -8.2e-11) (not (<= z 3.5e+19)))
(/ 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 <= -8.2e-11) || !(z <= 3.5e+19)) {
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 <= (-8.2d-11)) .or. (.not. (z <= 3.5d+19))) 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 <= -8.2e-11) || !(z <= 3.5e+19)) {
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 <= -8.2e-11) or not (z <= 3.5e+19): 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 <= -8.2e-11) || !(z <= 3.5e+19)) 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 <= -8.2e-11) || ~((z <= 3.5e+19)))
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, -8.2e-11], N[Not[LessEqual[z, 3.5e+19]], $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 -8.2 \cdot 10^{-11} \lor \neg \left(z \leq 3.5 \cdot 10^{+19}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -8.2000000000000001e-11 or 3.5e19 < z Initial program 81.4%
Taylor expanded in t around 0 72.9%
mul-1-neg72.9%
associate-/r*83.1%
distribute-neg-frac283.1%
neg-sub083.1%
sub-neg83.1%
+-commutative83.1%
associate--r+83.1%
neg-sub083.1%
remove-double-neg83.1%
Simplified83.1%
div-inv83.1%
Applied egg-rr83.1%
*-commutative83.1%
frac-times72.9%
*-un-lft-identity72.9%
Applied egg-rr72.9%
Taylor expanded in z around inf 64.2%
if -8.2000000000000001e-11 < z < 3.5e19Initial program 96.3%
Taylor expanded in z around 0 57.1%
Final simplification61.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 -1.8e+130) (not (<= z 2.7e+66)))
(/ x_m (* z t))
(/ 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 <= -1.8e+130) || !(z <= 2.7e+66)) {
tmp = x_m / (z * t);
} 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 <= (-1.8d+130)) .or. (.not. (z <= 2.7d+66))) then
tmp = x_m / (z * t)
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 <= -1.8e+130) || !(z <= 2.7e+66)) {
tmp = x_m / (z * t);
} 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 <= -1.8e+130) or not (z <= 2.7e+66): tmp = x_m / (z * t) 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 <= -1.8e+130) || !(z <= 2.7e+66)) tmp = Float64(x_m / Float64(z * t)); 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 <= -1.8e+130) || ~((z <= 2.7e+66)))
tmp = x_m / (z * t);
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, -1.8e+130], N[Not[LessEqual[z, 2.7e+66]], $MachinePrecision]], N[(x$95$m / N[(z * t), $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 -1.8 \cdot 10^{+130} \lor \neg \left(z \leq 2.7 \cdot 10^{+66}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.8000000000000001e130 or 2.7e66 < z Initial program 76.1%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around inf 45.8%
Taylor expanded in y around 0 38.6%
neg-mul-138.6%
Simplified38.6%
*-un-lft-identity38.6%
div-inv38.6%
frac-times38.4%
*-rgt-identity38.4%
add-sqr-sqrt11.3%
sqrt-unprod58.5%
sqr-neg58.5%
sqrt-unprod24.1%
add-sqr-sqrt35.3%
Applied egg-rr35.3%
*-lft-identity35.3%
*-commutative35.3%
Simplified35.3%
if -1.8000000000000001e130 < z < 2.7e66Initial program 94.5%
Taylor expanded in z around 0 46.0%
Final simplification42.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 (<= z -1.3e+35)
(/ x_m (* y z))
(if (<= z 9.6e+64) (/ x_m (* y t)) (/ x_m (* z 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 <= -1.3e+35) {
tmp = x_m / (y * z);
} else if (z <= 9.6e+64) {
tmp = x_m / (y * t);
} else {
tmp = x_m / (z * 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 <= (-1.3d+35)) then
tmp = x_m / (y * z)
else if (z <= 9.6d+64) then
tmp = x_m / (y * t)
else
tmp = x_m / (z * 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 <= -1.3e+35) {
tmp = x_m / (y * z);
} else if (z <= 9.6e+64) {
tmp = x_m / (y * t);
} else {
tmp = x_m / (z * 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 <= -1.3e+35: tmp = x_m / (y * z) elif z <= 9.6e+64: tmp = x_m / (y * t) else: tmp = x_m / (z * 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 <= -1.3e+35) tmp = Float64(x_m / Float64(y * z)); elseif (z <= 9.6e+64) tmp = Float64(x_m / Float64(y * t)); else tmp = Float64(x_m / Float64(z * 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 <= -1.3e+35)
tmp = x_m / (y * z);
elseif (z <= 9.6e+64)
tmp = x_m / (y * t);
else
tmp = x_m / (z * 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[LessEqual[z, -1.3e+35], N[(x$95$m / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.6e+64], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(z * 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 -1.3 \cdot 10^{+35}:\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{+64}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z \cdot t}\\
\end{array}
\end{array}
if z < -1.30000000000000003e35Initial program 79.7%
Taylor expanded in t around 0 74.7%
mul-1-neg74.7%
associate-/r*88.2%
distribute-neg-frac288.2%
neg-sub088.2%
sub-neg88.2%
+-commutative88.2%
associate--r+88.2%
neg-sub088.2%
remove-double-neg88.2%
Simplified88.2%
Taylor expanded in z around 0 41.9%
associate-*r/41.9%
neg-mul-141.9%
*-commutative41.9%
Simplified41.9%
add-sqr-sqrt25.2%
sqrt-unprod54.8%
sqr-neg54.8%
sqrt-unprod15.1%
add-sqr-sqrt37.0%
*-un-lft-identity37.0%
*-commutative37.0%
Applied egg-rr37.0%
*-lft-identity37.0%
*-commutative37.0%
Simplified37.0%
if -1.30000000000000003e35 < z < 9.59999999999999997e64Initial program 95.0%
Taylor expanded in z around 0 50.5%
if 9.59999999999999997e64 < z Initial program 79.1%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around inf 51.4%
Taylor expanded in y around 0 43.2%
neg-mul-143.2%
Simplified43.2%
*-un-lft-identity43.2%
div-inv43.2%
frac-times43.1%
*-rgt-identity43.1%
add-sqr-sqrt0.0%
sqrt-unprod55.9%
sqr-neg55.9%
sqrt-unprod38.2%
add-sqr-sqrt38.2%
Applied egg-rr38.2%
*-lft-identity38.2%
*-commutative38.2%
Simplified38.2%
Final simplification44.6%
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 87.9%
Taylor expanded in z around 0 36.5%
Final simplification36.5%
(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 2024150
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ x (* (- y z) (- t z))) 0) (/ (/ x (- y z)) (- t z)) (* x (/ 1 (* (- y z) (- t z))))))
(/ x (* (- y z) (- t z))))