
(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 17 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 3.6e-252)
(/ (/ x_m (- y z)) (- t z))
(/ (/ 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 tmp;
if (x_m <= 3.6e-252) {
tmp = (x_m / (y - z)) / (t - z);
} 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) :: tmp
if (x_m <= 3.6d-252) then
tmp = (x_m / (y - z)) / (t - z)
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 tmp;
if (x_m <= 3.6e-252) {
tmp = (x_m / (y - z)) / (t - z);
} 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): tmp = 0 if x_m <= 3.6e-252: tmp = (x_m / (y - z)) / (t - z) 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) tmp = 0.0 if (x_m <= 3.6e-252) tmp = Float64(Float64(x_m / Float64(y - z)) / Float64(t - z)); 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)
tmp = 0.0;
if (x_m <= 3.6e-252)
tmp = (x_m / (y - z)) / (t - z);
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_] := N[(x$95$s * If[LessEqual[x$95$m, 3.6e-252], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], 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])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 3.6 \cdot 10^{-252}:\\
\;\;\;\;\frac{\frac{x\_m}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y - z}\\
\end{array}
\end{array}
if x < 3.60000000000000023e-252Initial program 90.9%
Taylor expanded in x around 0 90.9%
associate-/l/96.0%
Simplified96.0%
if 3.60000000000000023e-252 < x Initial program 89.8%
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
(*
x_s
(if (<= z -1.35e+154)
(/ (/ x_m z) z)
(if (or (<= z -9.8e-147) (not (<= z 2.2e-85)))
(/ x_m (* z (- z t)))
(* (/ x_m y) (/ 1.0 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.35e+154) {
tmp = (x_m / z) / z;
} else if ((z <= -9.8e-147) || !(z <= 2.2e-85)) {
tmp = x_m / (z * (z - t));
} else {
tmp = (x_m / y) * (1.0 / 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.35d+154)) then
tmp = (x_m / z) / z
else if ((z <= (-9.8d-147)) .or. (.not. (z <= 2.2d-85))) then
tmp = x_m / (z * (z - t))
else
tmp = (x_m / y) * (1.0d0 / 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.35e+154) {
tmp = (x_m / z) / z;
} else if ((z <= -9.8e-147) || !(z <= 2.2e-85)) {
tmp = x_m / (z * (z - t));
} else {
tmp = (x_m / y) * (1.0 / 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.35e+154: tmp = (x_m / z) / z elif (z <= -9.8e-147) or not (z <= 2.2e-85): tmp = x_m / (z * (z - t)) else: tmp = (x_m / y) * (1.0 / 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.35e+154) tmp = Float64(Float64(x_m / z) / z); elseif ((z <= -9.8e-147) || !(z <= 2.2e-85)) tmp = Float64(x_m / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x_m / y) * Float64(1.0 / 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.35e+154)
tmp = (x_m / z) / z;
elseif ((z <= -9.8e-147) || ~((z <= 2.2e-85)))
tmp = x_m / (z * (z - t));
else
tmp = (x_m / y) * (1.0 / 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.35e+154], N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[z, -9.8e-147], N[Not[LessEqual[z, 2.2e-85]], $MachinePrecision]], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / y), $MachinePrecision] * N[(1.0 / 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.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z}\\
\mathbf{elif}\;z \leq -9.8 \cdot 10^{-147} \lor \neg \left(z \leq 2.2 \cdot 10^{-85}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y} \cdot \frac{1}{t}\\
\end{array}
\end{array}
if z < -1.35000000000000003e154Initial program 79.5%
Taylor expanded in y around 0 79.5%
mul-1-neg79.5%
associate-/r*97.2%
distribute-neg-frac297.2%
sub-neg97.2%
+-commutative97.2%
distribute-neg-in97.2%
remove-double-neg97.2%
unsub-neg97.2%
Simplified97.2%
Taylor expanded in z around inf 97.2%
if -1.35000000000000003e154 < z < -9.8000000000000001e-147 or 2.2e-85 < z Initial program 93.6%
Taylor expanded in y around 0 72.4%
mul-1-neg72.4%
distribute-rgt-neg-in72.4%
sub-neg72.4%
+-commutative72.4%
distribute-neg-in72.4%
remove-double-neg72.4%
unsub-neg72.4%
Simplified72.4%
if -9.8000000000000001e-147 < z < 2.2e-85Initial program 89.9%
Taylor expanded in z around 0 72.6%
*-un-lft-identity72.6%
times-frac76.0%
Applied egg-rr76.0%
Final simplification77.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 (<= t -9.2e-55)
(/ (/ x_m y) t)
(if (<= t 4e-98)
(/ x_m (* z (- z y)))
(if (<= t 3.9e+152) (/ x_m (* (- y 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 (t <= -9.2e-55) {
tmp = (x_m / y) / t;
} else if (t <= 4e-98) {
tmp = x_m / (z * (z - y));
} else if (t <= 3.9e+152) {
tmp = x_m / ((y - 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 (t <= (-9.2d-55)) then
tmp = (x_m / y) / t
else if (t <= 4d-98) then
tmp = x_m / (z * (z - y))
else if (t <= 3.9d+152) then
tmp = x_m / ((y - 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 (t <= -9.2e-55) {
tmp = (x_m / y) / t;
} else if (t <= 4e-98) {
tmp = x_m / (z * (z - y));
} else if (t <= 3.9e+152) {
tmp = x_m / ((y - 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 t <= -9.2e-55: tmp = (x_m / y) / t elif t <= 4e-98: tmp = x_m / (z * (z - y)) elif t <= 3.9e+152: tmp = x_m / ((y - 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 (t <= -9.2e-55) tmp = Float64(Float64(x_m / y) / t); elseif (t <= 4e-98) tmp = Float64(x_m / Float64(z * Float64(z - y))); elseif (t <= 3.9e+152) tmp = Float64(x_m / Float64(Float64(y - 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 (t <= -9.2e-55)
tmp = (x_m / y) / t;
elseif (t <= 4e-98)
tmp = x_m / (z * (z - y));
elseif (t <= 3.9e+152)
tmp = x_m / ((y - 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[t, -9.2e-55], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 4e-98], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.9e+152], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * 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}\;t \leq -9.2 \cdot 10^{-55}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-98}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{+152}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < -9.20000000000000046e-55Initial program 89.7%
Taylor expanded in x around 0 89.7%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around inf 83.9%
Taylor expanded in y around inf 63.2%
if -9.20000000000000046e-55 < t < 3.99999999999999976e-98Initial program 91.8%
Taylor expanded in t around 0 76.8%
mul-1-neg76.8%
distribute-rgt-neg-in76.8%
neg-sub076.8%
sub-neg76.8%
+-commutative76.8%
associate--r+76.8%
neg-sub076.8%
remove-double-neg76.8%
Simplified76.8%
if 3.99999999999999976e-98 < t < 3.90000000000000011e152Initial program 91.4%
Taylor expanded in t around inf 73.5%
if 3.90000000000000011e152 < t Initial program 86.9%
associate-/l/94.7%
Simplified94.7%
Taylor expanded in t around inf 92.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 -2.6e+25)
(/ (/ x_m z) z)
(if (<= z -7.2e-99)
(/ x_m (* z (- t)))
(if (<= z 4.8e+26) (/ (/ x_m y) t) (/ 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 tmp;
if (z <= -2.6e+25) {
tmp = (x_m / z) / z;
} else if (z <= -7.2e-99) {
tmp = x_m / (z * -t);
} else if (z <= 4.8e+26) {
tmp = (x_m / y) / t;
} 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) :: tmp
if (z <= (-2.6d+25)) then
tmp = (x_m / z) / z
else if (z <= (-7.2d-99)) then
tmp = x_m / (z * -t)
else if (z <= 4.8d+26) then
tmp = (x_m / y) / t
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 tmp;
if (z <= -2.6e+25) {
tmp = (x_m / z) / z;
} else if (z <= -7.2e-99) {
tmp = x_m / (z * -t);
} else if (z <= 4.8e+26) {
tmp = (x_m / y) / t;
} 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): tmp = 0 if z <= -2.6e+25: tmp = (x_m / z) / z elif z <= -7.2e-99: tmp = x_m / (z * -t) elif z <= 4.8e+26: tmp = (x_m / y) / t 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) tmp = 0.0 if (z <= -2.6e+25) tmp = Float64(Float64(x_m / z) / z); elseif (z <= -7.2e-99) tmp = Float64(x_m / Float64(z * Float64(-t))); elseif (z <= 4.8e+26) tmp = Float64(Float64(x_m / y) / t); else tmp = Float64(x_m / Float64(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)
tmp = 0.0;
if (z <= -2.6e+25)
tmp = (x_m / z) / z;
elseif (z <= -7.2e-99)
tmp = x_m / (z * -t);
elseif (z <= 4.8e+26)
tmp = (x_m / y) / t;
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_] := N[(x$95$s * If[LessEqual[z, -2.6e+25], N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -7.2e-99], N[(x$95$m / N[(z * (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e+26], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], N[(x$95$m / N[(z * 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}\;z \leq -2.6 \cdot 10^{+25}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z}\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-99}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(-t\right)}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+26}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\
\end{array}
\end{array}
if z < -2.5999999999999998e25Initial program 85.0%
Taylor expanded in y around 0 81.0%
mul-1-neg81.0%
associate-/r*89.7%
distribute-neg-frac289.7%
sub-neg89.7%
+-commutative89.7%
distribute-neg-in89.7%
remove-double-neg89.7%
unsub-neg89.7%
Simplified89.7%
Taylor expanded in z around inf 79.2%
if -2.5999999999999998e25 < z < -7.2000000000000001e-99Initial program 92.4%
Taylor expanded in t around inf 50.4%
Taylor expanded in y around 0 38.4%
associate-*r/38.4%
neg-mul-138.4%
Simplified38.4%
if -7.2000000000000001e-99 < z < 4.80000000000000009e26Initial program 91.9%
Taylor expanded in x around 0 91.9%
associate-/l/93.6%
Simplified93.6%
Taylor expanded in t around inf 80.8%
Taylor expanded in y around inf 66.5%
if 4.80000000000000009e26 < z Initial program 92.6%
Taylor expanded in y around 0 83.4%
mul-1-neg83.4%
distribute-rgt-neg-in83.4%
sub-neg83.4%
+-commutative83.4%
distribute-neg-in83.4%
remove-double-neg83.4%
unsub-neg83.4%
Simplified83.4%
Taylor expanded in z around inf 77.7%
Final simplification69.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 (<= y -6.6e-43)
(/ (/ x_m (- t z)) y)
(if (<= y 7e-233) (/ (/ x_m z) (- z t)) (/ (/ x_m (- y 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 (y <= -6.6e-43) {
tmp = (x_m / (t - z)) / y;
} else if (y <= 7e-233) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / (y - 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 (y <= (-6.6d-43)) then
tmp = (x_m / (t - z)) / y
else if (y <= 7d-233) then
tmp = (x_m / z) / (z - t)
else
tmp = (x_m / (y - 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 (y <= -6.6e-43) {
tmp = (x_m / (t - z)) / y;
} else if (y <= 7e-233) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / (y - 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 y <= -6.6e-43: tmp = (x_m / (t - z)) / y elif y <= 7e-233: tmp = (x_m / z) / (z - t) else: tmp = (x_m / (y - 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 (y <= -6.6e-43) tmp = Float64(Float64(x_m / Float64(t - z)) / y); elseif (y <= 7e-233) tmp = Float64(Float64(x_m / z) / Float64(z - t)); else tmp = Float64(Float64(x_m / Float64(y - 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 (y <= -6.6e-43)
tmp = (x_m / (t - z)) / y;
elseif (y <= 7e-233)
tmp = (x_m / z) / (z - t);
else
tmp = (x_m / (y - 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[y, -6.6e-43], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 7e-233], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $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}\;y \leq -6.6 \cdot 10^{-43}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-233}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\
\end{array}
\end{array}
if y < -6.60000000000000031e-43Initial program 88.5%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in y around inf 88.5%
if -6.60000000000000031e-43 < y < 6.99999999999999982e-233Initial program 91.6%
Taylor expanded in y around 0 84.0%
mul-1-neg84.0%
associate-/r*88.9%
distribute-neg-frac288.9%
sub-neg88.9%
+-commutative88.9%
distribute-neg-in88.9%
remove-double-neg88.9%
unsub-neg88.9%
Simplified88.9%
if 6.99999999999999982e-233 < y Initial program 91.0%
Taylor expanded in x around 0 91.0%
associate-/l/95.9%
Simplified95.9%
Taylor expanded in t around inf 70.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 (<= y -2.8e-38)
(/ (/ x_m (- t z)) y)
(if (<= y 6.2e-233) (/ (/ x_m z) (- z t)) (/ x_m (* (- y 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 (y <= -2.8e-38) {
tmp = (x_m / (t - z)) / y;
} else if (y <= 6.2e-233) {
tmp = (x_m / z) / (z - t);
} else {
tmp = x_m / ((y - 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 (y <= (-2.8d-38)) then
tmp = (x_m / (t - z)) / y
else if (y <= 6.2d-233) then
tmp = (x_m / z) / (z - t)
else
tmp = x_m / ((y - 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 (y <= -2.8e-38) {
tmp = (x_m / (t - z)) / y;
} else if (y <= 6.2e-233) {
tmp = (x_m / z) / (z - t);
} else {
tmp = x_m / ((y - 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 y <= -2.8e-38: tmp = (x_m / (t - z)) / y elif y <= 6.2e-233: tmp = (x_m / z) / (z - t) else: tmp = x_m / ((y - 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 (y <= -2.8e-38) tmp = Float64(Float64(x_m / Float64(t - z)) / y); elseif (y <= 6.2e-233) tmp = Float64(Float64(x_m / z) / Float64(z - t)); else tmp = Float64(x_m / Float64(Float64(y - 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 (y <= -2.8e-38)
tmp = (x_m / (t - z)) / y;
elseif (y <= 6.2e-233)
tmp = (x_m / z) / (z - t);
else
tmp = x_m / ((y - 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[y, -2.8e-38], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 6.2e-233], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * 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}\;y \leq -2.8 \cdot 10^{-38}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-233}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -2.8e-38Initial program 88.5%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in y around inf 88.5%
if -2.8e-38 < y < 6.2000000000000003e-233Initial program 91.6%
Taylor expanded in y around 0 84.0%
mul-1-neg84.0%
associate-/r*88.9%
distribute-neg-frac288.9%
sub-neg88.9%
+-commutative88.9%
distribute-neg-in88.9%
remove-double-neg88.9%
unsub-neg88.9%
Simplified88.9%
if 6.2000000000000003e-233 < y Initial program 91.0%
Taylor expanded in t around inf 61.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 (<= y -1.25e-32)
(/ (/ x_m y) (- t z))
(if (<= y 7.4e-236) (/ (/ x_m z) (- z t)) (/ x_m (* (- y 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 (y <= -1.25e-32) {
tmp = (x_m / y) / (t - z);
} else if (y <= 7.4e-236) {
tmp = (x_m / z) / (z - t);
} else {
tmp = x_m / ((y - 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 (y <= (-1.25d-32)) then
tmp = (x_m / y) / (t - z)
else if (y <= 7.4d-236) then
tmp = (x_m / z) / (z - t)
else
tmp = x_m / ((y - 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 (y <= -1.25e-32) {
tmp = (x_m / y) / (t - z);
} else if (y <= 7.4e-236) {
tmp = (x_m / z) / (z - t);
} else {
tmp = x_m / ((y - 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 y <= -1.25e-32: tmp = (x_m / y) / (t - z) elif y <= 7.4e-236: tmp = (x_m / z) / (z - t) else: tmp = x_m / ((y - 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 (y <= -1.25e-32) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= 7.4e-236) tmp = Float64(Float64(x_m / z) / Float64(z - t)); else tmp = Float64(x_m / Float64(Float64(y - 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 (y <= -1.25e-32)
tmp = (x_m / y) / (t - z);
elseif (y <= 7.4e-236)
tmp = (x_m / z) / (z - t);
else
tmp = x_m / ((y - 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[y, -1.25e-32], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.4e-236], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * 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}\;y \leq -1.25 \cdot 10^{-32}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-236}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -1.25e-32Initial program 88.5%
Taylor expanded in y around inf 82.5%
associate-/r*84.9%
Simplified84.9%
if -1.25e-32 < y < 7.40000000000000042e-236Initial program 91.3%
Taylor expanded in y around 0 83.5%
mul-1-neg83.5%
associate-/r*88.5%
distribute-neg-frac288.5%
sub-neg88.5%
+-commutative88.5%
distribute-neg-in88.5%
remove-double-neg88.5%
unsub-neg88.5%
Simplified88.5%
if 7.40000000000000042e-236 < y Initial program 91.1%
Taylor expanded in t around inf 61.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 (<= y -9.4e-35)
(/ (/ x_m y) (- t z))
(if (<= y 1.15e-235) (/ x_m (* z (- z t))) (/ x_m (* (- y 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 (y <= -9.4e-35) {
tmp = (x_m / y) / (t - z);
} else if (y <= 1.15e-235) {
tmp = x_m / (z * (z - t));
} else {
tmp = x_m / ((y - 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 (y <= (-9.4d-35)) then
tmp = (x_m / y) / (t - z)
else if (y <= 1.15d-235) then
tmp = x_m / (z * (z - t))
else
tmp = x_m / ((y - 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 (y <= -9.4e-35) {
tmp = (x_m / y) / (t - z);
} else if (y <= 1.15e-235) {
tmp = x_m / (z * (z - t));
} else {
tmp = x_m / ((y - 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 y <= -9.4e-35: tmp = (x_m / y) / (t - z) elif y <= 1.15e-235: tmp = x_m / (z * (z - t)) else: tmp = x_m / ((y - 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 (y <= -9.4e-35) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= 1.15e-235) tmp = Float64(x_m / Float64(z * Float64(z - t))); else tmp = Float64(x_m / Float64(Float64(y - 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 (y <= -9.4e-35)
tmp = (x_m / y) / (t - z);
elseif (y <= 1.15e-235)
tmp = x_m / (z * (z - t));
else
tmp = x_m / ((y - 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[y, -9.4e-35], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e-235], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * 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}\;y \leq -9.4 \cdot 10^{-35}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-235}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -9.4e-35Initial program 88.5%
Taylor expanded in y around inf 82.5%
associate-/r*84.9%
Simplified84.9%
if -9.4e-35 < y < 1.14999999999999999e-235Initial program 91.3%
Taylor expanded in y around 0 83.5%
mul-1-neg83.5%
distribute-rgt-neg-in83.5%
sub-neg83.5%
+-commutative83.5%
distribute-neg-in83.5%
remove-double-neg83.5%
unsub-neg83.5%
Simplified83.5%
if 1.14999999999999999e-235 < y Initial program 91.1%
Taylor expanded in t around inf 61.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 -2.8e-55)
(/ (/ x_m y) t)
(if (<= t 1.8e-97) (/ x_m (* z (- z y))) (/ x_m (* (- y 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 (t <= -2.8e-55) {
tmp = (x_m / y) / t;
} else if (t <= 1.8e-97) {
tmp = x_m / (z * (z - y));
} else {
tmp = x_m / ((y - 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 (t <= (-2.8d-55)) then
tmp = (x_m / y) / t
else if (t <= 1.8d-97) then
tmp = x_m / (z * (z - y))
else
tmp = x_m / ((y - 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 (t <= -2.8e-55) {
tmp = (x_m / y) / t;
} else if (t <= 1.8e-97) {
tmp = x_m / (z * (z - y));
} else {
tmp = x_m / ((y - 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 t <= -2.8e-55: tmp = (x_m / y) / t elif t <= 1.8e-97: tmp = x_m / (z * (z - y)) else: tmp = x_m / ((y - 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 (t <= -2.8e-55) tmp = Float64(Float64(x_m / y) / t); elseif (t <= 1.8e-97) tmp = Float64(x_m / Float64(z * Float64(z - y))); else tmp = Float64(x_m / Float64(Float64(y - 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 (t <= -2.8e-55)
tmp = (x_m / y) / t;
elseif (t <= 1.8e-97)
tmp = x_m / (z * (z - y));
else
tmp = x_m / ((y - 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[t, -2.8e-55], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 1.8e-97], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * 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}\;t \leq -2.8 \cdot 10^{-55}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-97}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -2.79999999999999984e-55Initial program 89.7%
Taylor expanded in x around 0 89.7%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around inf 83.9%
Taylor expanded in y around inf 63.2%
if -2.79999999999999984e-55 < t < 1.79999999999999999e-97Initial program 91.8%
Taylor expanded in t around 0 76.8%
mul-1-neg76.8%
distribute-rgt-neg-in76.8%
neg-sub076.8%
sub-neg76.8%
+-commutative76.8%
associate--r+76.8%
neg-sub076.8%
remove-double-neg76.8%
Simplified76.8%
if 1.79999999999999999e-97 < t Initial program 89.6%
Taylor expanded in t around inf 79.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 -5.6e+23) (not (<= z 1.15e+31)))
(/ 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 <= -5.6e+23) || !(z <= 1.15e+31)) {
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 <= (-5.6d+23)) .or. (.not. (z <= 1.15d+31))) 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 <= -5.6e+23) || !(z <= 1.15e+31)) {
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 <= -5.6e+23) or not (z <= 1.15e+31): 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 <= -5.6e+23) || !(z <= 1.15e+31)) 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 <= -5.6e+23) || ~((z <= 1.15e+31)))
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, -5.6e+23], N[Not[LessEqual[z, 1.15e+31]], $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 -5.6 \cdot 10^{+23} \lor \neg \left(z \leq 1.15 \cdot 10^{+31}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if z < -5.6e23 or 1.15e31 < z Initial program 88.5%
Taylor expanded in y around 0 81.4%
mul-1-neg81.4%
distribute-rgt-neg-in81.4%
sub-neg81.4%
+-commutative81.4%
distribute-neg-in81.4%
remove-double-neg81.4%
unsub-neg81.4%
Simplified81.4%
Taylor expanded in z around inf 72.4%
if -5.6e23 < z < 1.15e31Initial program 91.9%
associate-/l/94.2%
Simplified94.2%
Taylor expanded in y around inf 72.1%
Taylor expanded in t around inf 59.4%
Final simplification65.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.1e+22) (not (<= z 6.6e-23)))
(/ 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 <= -2.1e+22) || !(z <= 6.6e-23)) {
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 <= (-2.1d+22)) .or. (.not. (z <= 6.6d-23))) 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 <= -2.1e+22) || !(z <= 6.6e-23)) {
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 <= -2.1e+22) or not (z <= 6.6e-23): 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 <= -2.1e+22) || !(z <= 6.6e-23)) 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 <= -2.1e+22) || ~((z <= 6.6e-23)))
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, -2.1e+22], N[Not[LessEqual[z, 6.6e-23]], $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 -2.1 \cdot 10^{+22} \lor \neg \left(z \leq 6.6 \cdot 10^{-23}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -2.0999999999999998e22 or 6.60000000000000041e-23 < z Initial program 88.9%
Taylor expanded in y around 0 80.9%
mul-1-neg80.9%
distribute-rgt-neg-in80.9%
sub-neg80.9%
+-commutative80.9%
distribute-neg-in80.9%
remove-double-neg80.9%
unsub-neg80.9%
Simplified80.9%
Taylor expanded in z around inf 68.2%
if -2.0999999999999998e22 < z < 6.60000000000000041e-23Initial program 91.9%
Taylor expanded in z around 0 59.3%
Final simplification63.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 (or (<= z -4.1e+83) (not (<= z 6.5e+58)))
(/ 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 <= -4.1e+83) || !(z <= 6.5e+58)) {
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 <= (-4.1d+83)) .or. (.not. (z <= 6.5d+58))) 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 <= -4.1e+83) || !(z <= 6.5e+58)) {
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 <= -4.1e+83) or not (z <= 6.5e+58): 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 <= -4.1e+83) || !(z <= 6.5e+58)) 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 <= -4.1e+83) || ~((z <= 6.5e+58)))
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, -4.1e+83], N[Not[LessEqual[z, 6.5e+58]], $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 -4.1 \cdot 10^{+83} \lor \neg \left(z \leq 6.5 \cdot 10^{+58}\right):\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -4.1000000000000001e83 or 6.49999999999999998e58 < z Initial program 87.5%
Taylor expanded in t around 0 83.6%
mul-1-neg83.6%
associate-/r*93.0%
distribute-neg-frac293.0%
neg-sub093.0%
sub-neg93.0%
+-commutative93.0%
associate--r+93.0%
neg-sub093.0%
remove-double-neg93.0%
Simplified93.0%
Taylor expanded in z around 0 59.4%
neg-mul-159.4%
Simplified59.4%
div-inv59.4%
associate-/l*49.7%
add-sqr-sqrt26.6%
sqrt-unprod45.2%
sqr-neg45.2%
sqrt-unprod21.0%
add-sqr-sqrt45.6%
Applied egg-rr45.6%
associate-/r*46.6%
associate-*r/46.6%
*-rgt-identity46.6%
*-commutative46.6%
Simplified46.6%
if -4.1000000000000001e83 < z < 6.49999999999999998e58Initial program 92.2%
Taylor expanded in z around 0 52.5%
Final simplification50.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 -1.05e+21)
(/ 1.0 (* z (/ z x_m)))
(if (<= z 6e+31) (/ (/ x_m t) y) (/ 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 tmp;
if (z <= -1.05e+21) {
tmp = 1.0 / (z * (z / x_m));
} else if (z <= 6e+31) {
tmp = (x_m / t) / y;
} 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) :: tmp
if (z <= (-1.05d+21)) then
tmp = 1.0d0 / (z * (z / x_m))
else if (z <= 6d+31) then
tmp = (x_m / t) / y
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 tmp;
if (z <= -1.05e+21) {
tmp = 1.0 / (z * (z / x_m));
} else if (z <= 6e+31) {
tmp = (x_m / t) / y;
} 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): tmp = 0 if z <= -1.05e+21: tmp = 1.0 / (z * (z / x_m)) elif z <= 6e+31: tmp = (x_m / t) / y 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) tmp = 0.0 if (z <= -1.05e+21) tmp = Float64(1.0 / Float64(z * Float64(z / x_m))); elseif (z <= 6e+31) tmp = Float64(Float64(x_m / t) / y); else tmp = Float64(x_m / Float64(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)
tmp = 0.0;
if (z <= -1.05e+21)
tmp = 1.0 / (z * (z / x_m));
elseif (z <= 6e+31)
tmp = (x_m / t) / y;
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_] := N[(x$95$s * If[LessEqual[z, -1.05e+21], N[(1.0 / N[(z * N[(z / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+31], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], N[(x$95$m / N[(z * 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}\;z \leq -1.05 \cdot 10^{+21}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x\_m}}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+31}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\
\end{array}
\end{array}
if z < -1.05e21Initial program 85.7%
Taylor expanded in y around 0 80.4%
mul-1-neg80.4%
associate-/r*88.7%
distribute-neg-frac288.7%
sub-neg88.7%
+-commutative88.7%
distribute-neg-in88.7%
remove-double-neg88.7%
unsub-neg88.7%
Simplified88.7%
clear-num87.3%
inv-pow87.3%
div-inv87.3%
clear-num87.3%
Applied egg-rr87.3%
unpow-187.3%
Simplified87.3%
Taylor expanded in z around inf 78.0%
if -1.05e21 < z < 5.99999999999999978e31Initial program 91.8%
associate-/l/94.1%
Simplified94.1%
Taylor expanded in y around inf 72.4%
Taylor expanded in t around inf 59.5%
if 5.99999999999999978e31 < z Initial program 92.6%
Taylor expanded in y around 0 83.4%
mul-1-neg83.4%
distribute-rgt-neg-in83.4%
sub-neg83.4%
+-commutative83.4%
distribute-neg-in83.4%
remove-double-neg83.4%
unsub-neg83.4%
Simplified83.4%
Taylor expanded in z around inf 77.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 -8e+23)
(/ (/ x_m z) z)
(if (<= z 5.4e+26) (/ (/ x_m t) y) (/ 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 tmp;
if (z <= -8e+23) {
tmp = (x_m / z) / z;
} else if (z <= 5.4e+26) {
tmp = (x_m / t) / y;
} 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) :: tmp
if (z <= (-8d+23)) then
tmp = (x_m / z) / z
else if (z <= 5.4d+26) then
tmp = (x_m / t) / y
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 tmp;
if (z <= -8e+23) {
tmp = (x_m / z) / z;
} else if (z <= 5.4e+26) {
tmp = (x_m / t) / y;
} 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): tmp = 0 if z <= -8e+23: tmp = (x_m / z) / z elif z <= 5.4e+26: tmp = (x_m / t) / y 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) tmp = 0.0 if (z <= -8e+23) tmp = Float64(Float64(x_m / z) / z); elseif (z <= 5.4e+26) tmp = Float64(Float64(x_m / t) / y); else tmp = Float64(x_m / Float64(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)
tmp = 0.0;
if (z <= -8e+23)
tmp = (x_m / z) / z;
elseif (z <= 5.4e+26)
tmp = (x_m / t) / y;
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_] := N[(x$95$s * If[LessEqual[z, -8e+23], N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 5.4e+26], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], N[(x$95$m / N[(z * 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}\;z \leq -8 \cdot 10^{+23}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z}\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+26}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\
\end{array}
\end{array}
if z < -7.9999999999999993e23Initial program 85.2%
Taylor expanded in y around 0 79.8%
mul-1-neg79.8%
associate-/r*88.4%
distribute-neg-frac288.4%
sub-neg88.4%
+-commutative88.4%
distribute-neg-in88.4%
remove-double-neg88.4%
unsub-neg88.4%
Simplified88.4%
Taylor expanded in z around inf 78.1%
if -7.9999999999999993e23 < z < 5.4e26Initial program 91.9%
associate-/l/94.2%
Simplified94.2%
Taylor expanded in y around inf 72.1%
Taylor expanded in t around inf 59.4%
if 5.4e26 < z Initial program 92.6%
Taylor expanded in y around 0 83.4%
mul-1-neg83.4%
distribute-rgt-neg-in83.4%
sub-neg83.4%
+-commutative83.4%
distribute-neg-in83.4%
remove-double-neg83.4%
unsub-neg83.4%
Simplified83.4%
Taylor expanded in z around inf 77.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 (<= x_m 1.7e-254) (/ (/ x_m (- y z)) t) (/ (/ 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 tmp;
if (x_m <= 1.7e-254) {
tmp = (x_m / (y - z)) / t;
} 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) :: tmp
if (x_m <= 1.7d-254) then
tmp = (x_m / (y - z)) / t
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 tmp;
if (x_m <= 1.7e-254) {
tmp = (x_m / (y - z)) / t;
} 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): tmp = 0 if x_m <= 1.7e-254: tmp = (x_m / (y - z)) / t 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) tmp = 0.0 if (x_m <= 1.7e-254) tmp = Float64(Float64(x_m / Float64(y - z)) / t); 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)
tmp = 0.0;
if (x_m <= 1.7e-254)
tmp = (x_m / (y - z)) / t;
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_] := N[(x$95$s * If[LessEqual[x$95$m, 1.7e-254], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], 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])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 1.7 \cdot 10^{-254}:\\
\;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y - z}\\
\end{array}
\end{array}
if x < 1.69999999999999996e-254Initial program 90.9%
Taylor expanded in x around 0 90.9%
associate-/l/96.0%
Simplified96.0%
Taylor expanded in t around inf 71.6%
if 1.69999999999999996e-254 < x Initial program 89.8%
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 (* x_s (if (<= y -1.15e+150) (/ (/ x_m (- t z)) y) (/ x_m (* (- y z) (- t 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.15e+150) {
tmp = (x_m / (t - z)) / y;
} else {
tmp = x_m / ((y - z) * (t - 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.15d+150)) then
tmp = (x_m / (t - z)) / y
else
tmp = x_m / ((y - z) * (t - 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.15e+150) {
tmp = (x_m / (t - z)) / y;
} else {
tmp = x_m / ((y - z) * (t - 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.15e+150: tmp = (x_m / (t - z)) / y else: tmp = x_m / ((y - z) * (t - 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.15e+150) tmp = Float64(Float64(x_m / Float64(t - z)) / y); else tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - 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.15e+150)
tmp = (x_m / (t - z)) / y;
else
tmp = x_m / ((y - z) * (t - 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.15e+150], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - 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}\;y \leq -1.15 \cdot 10^{+150}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\end{array}
\end{array}
if y < -1.15000000000000001e150Initial program 83.6%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around inf 97.5%
if -1.15000000000000001e150 < y Initial program 91.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 (/ 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 90.4%
Taylor expanded in z around 0 41.6%
Final simplification41.6%
(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 2024116
(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))))