
(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 16 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 1.12e-10)
(/ 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 <= 1.12e-10) {
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 <= 1.12d-10) 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 <= 1.12e-10) {
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 <= 1.12e-10: 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 <= 1.12e-10) tmp = Float64(x_m / Float64(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 <= 1.12e-10)
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, 1.12e-10], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $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 1.12 \cdot 10^{-10}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y - z}\\
\end{array}
\end{array}
if x < 1.12e-10Initial program 94.3%
if 1.12e-10 < x Initial program 84.8%
associate-/l/99.5%
Simplified99.5%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (/ x_m y) t)))
(*
x_s
(if (<= y -3.4e+143)
t_1
(if (<= y -9.4e-63)
(/ x_m (* y (- z)))
(if (<= y -2.7e-139)
(/ x_m (* y t))
(if (<= y 2.5e-205) (/ x_m (* z (- t))) 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) / t;
double tmp;
if (y <= -3.4e+143) {
tmp = t_1;
} else if (y <= -9.4e-63) {
tmp = x_m / (y * -z);
} else if (y <= -2.7e-139) {
tmp = x_m / (y * t);
} else if (y <= 2.5e-205) {
tmp = x_m / (z * -t);
} 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) / t
if (y <= (-3.4d+143)) then
tmp = t_1
else if (y <= (-9.4d-63)) then
tmp = x_m / (y * -z)
else if (y <= (-2.7d-139)) then
tmp = x_m / (y * t)
else if (y <= 2.5d-205) then
tmp = x_m / (z * -t)
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) / t;
double tmp;
if (y <= -3.4e+143) {
tmp = t_1;
} else if (y <= -9.4e-63) {
tmp = x_m / (y * -z);
} else if (y <= -2.7e-139) {
tmp = x_m / (y * t);
} else if (y <= 2.5e-205) {
tmp = x_m / (z * -t);
} 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) / t tmp = 0 if y <= -3.4e+143: tmp = t_1 elif y <= -9.4e-63: tmp = x_m / (y * -z) elif y <= -2.7e-139: tmp = x_m / (y * t) elif y <= 2.5e-205: tmp = x_m / (z * -t) 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 / y) / t) tmp = 0.0 if (y <= -3.4e+143) tmp = t_1; elseif (y <= -9.4e-63) tmp = Float64(x_m / Float64(y * Float64(-z))); elseif (y <= -2.7e-139) tmp = Float64(x_m / Float64(y * t)); elseif (y <= 2.5e-205) tmp = Float64(x_m / Float64(z * Float64(-t))); 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) / t;
tmp = 0.0;
if (y <= -3.4e+143)
tmp = t_1;
elseif (y <= -9.4e-63)
tmp = x_m / (y * -z);
elseif (y <= -2.7e-139)
tmp = x_m / (y * t);
elseif (y <= 2.5e-205)
tmp = x_m / (z * -t);
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 / y), $MachinePrecision] / t), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -3.4e+143], t$95$1, If[LessEqual[y, -9.4e-63], N[(x$95$m / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.7e-139], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e-205], N[(x$95$m / N[(z * (-t)), $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{\frac{x\_m}{y}}{t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -9.4 \cdot 10^{-63}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(-z\right)}\\
\mathbf{elif}\;y \leq -2.7 \cdot 10^{-139}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-205}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if y < -3.39999999999999982e143 or 2.5e-205 < y Initial program 92.5%
Taylor expanded in y around inf 75.1%
associate-/r*74.9%
Simplified74.9%
Taylor expanded in t around inf 60.2%
if -3.39999999999999982e143 < y < -9.4000000000000001e-63Initial program 93.5%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in y around inf 69.9%
Taylor expanded in t around 0 41.2%
associate-*r/41.2%
neg-mul-141.2%
*-commutative41.2%
Simplified41.2%
if -9.4000000000000001e-63 < y < -2.6999999999999998e-139Initial program 94.5%
Taylor expanded in z around 0 40.7%
if -2.6999999999999998e-139 < y < 2.5e-205Initial program 90.0%
associate-/l/95.6%
Simplified95.6%
Taylor expanded in t around inf 51.9%
Taylor expanded in y around 0 51.1%
associate-*r/51.1%
neg-mul-151.1%
Simplified51.1%
Final simplification53.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 -1.45e-149)
(/ 1.0 (* t (/ y x_m)))
(if (<= t 3.2e-52)
(- (/ (/ x_m z) y))
(if (<= t 6.5e+211) (/ (/ x_m t) y) (/ (/ x_m (- 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 (t <= -1.45e-149) {
tmp = 1.0 / (t * (y / x_m));
} else if (t <= 3.2e-52) {
tmp = -((x_m / z) / y);
} else if (t <= 6.5e+211) {
tmp = (x_m / t) / y;
} else {
tmp = (x_m / -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 (t <= (-1.45d-149)) then
tmp = 1.0d0 / (t * (y / x_m))
else if (t <= 3.2d-52) then
tmp = -((x_m / z) / y)
else if (t <= 6.5d+211) then
tmp = (x_m / t) / y
else
tmp = (x_m / -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 (t <= -1.45e-149) {
tmp = 1.0 / (t * (y / x_m));
} else if (t <= 3.2e-52) {
tmp = -((x_m / z) / y);
} else if (t <= 6.5e+211) {
tmp = (x_m / t) / y;
} else {
tmp = (x_m / -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 t <= -1.45e-149: tmp = 1.0 / (t * (y / x_m)) elif t <= 3.2e-52: tmp = -((x_m / z) / y) elif t <= 6.5e+211: tmp = (x_m / t) / y else: tmp = (x_m / -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 (t <= -1.45e-149) tmp = Float64(1.0 / Float64(t * Float64(y / x_m))); elseif (t <= 3.2e-52) tmp = Float64(-Float64(Float64(x_m / z) / y)); elseif (t <= 6.5e+211) tmp = Float64(Float64(x_m / t) / y); else tmp = Float64(Float64(x_m / 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 (t <= -1.45e-149)
tmp = 1.0 / (t * (y / x_m));
elseif (t <= 3.2e-52)
tmp = -((x_m / z) / y);
elseif (t <= 6.5e+211)
tmp = (x_m / t) / y;
else
tmp = (x_m / -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[t, -1.45e-149], N[(1.0 / N[(t * N[(y / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e-52], (-N[(N[(x$95$m / z), $MachinePrecision] / y), $MachinePrecision]), If[LessEqual[t, 6.5e+211], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], N[(N[(x$95$m / (-t)), $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])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{-149}:\\
\;\;\;\;\frac{1}{t \cdot \frac{y}{x\_m}}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-52}:\\
\;\;\;\;-\frac{\frac{x\_m}{z}}{y}\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{+211}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{-t}}{z}\\
\end{array}
\end{array}
if t < -1.45e-149Initial program 90.4%
associate-/l/95.3%
clear-num94.7%
inv-pow94.7%
div-inv94.7%
clear-num95.0%
Applied egg-rr95.0%
unpow-195.0%
Simplified95.0%
Taylor expanded in z around 0 51.6%
associate-/l*51.6%
Simplified51.6%
if -1.45e-149 < t < 3.2000000000000001e-52Initial program 95.1%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around inf 62.8%
Taylor expanded in t around 0 54.0%
associate-*r/54.0%
neg-mul-154.0%
Simplified54.0%
if 3.2000000000000001e-52 < t < 6.4999999999999996e211Initial program 92.2%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around inf 83.3%
Taylor expanded in y around inf 59.6%
if 6.4999999999999996e211 < t Initial program 91.6%
associate-/l/89.7%
Simplified89.7%
Taylor expanded in t around inf 89.7%
Taylor expanded in y around 0 65.9%
neg-mul-165.9%
Simplified65.9%
Final simplification55.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 -2.4e-153)
(/ (/ x_m y) t)
(if (<= t 6.5e-52)
(- (/ (/ x_m z) y))
(if (<= t 1e+212) (/ (/ x_m t) y) (/ (/ x_m (- 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 (t <= -2.4e-153) {
tmp = (x_m / y) / t;
} else if (t <= 6.5e-52) {
tmp = -((x_m / z) / y);
} else if (t <= 1e+212) {
tmp = (x_m / t) / y;
} else {
tmp = (x_m / -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 (t <= (-2.4d-153)) then
tmp = (x_m / y) / t
else if (t <= 6.5d-52) then
tmp = -((x_m / z) / y)
else if (t <= 1d+212) then
tmp = (x_m / t) / y
else
tmp = (x_m / -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 (t <= -2.4e-153) {
tmp = (x_m / y) / t;
} else if (t <= 6.5e-52) {
tmp = -((x_m / z) / y);
} else if (t <= 1e+212) {
tmp = (x_m / t) / y;
} else {
tmp = (x_m / -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 t <= -2.4e-153: tmp = (x_m / y) / t elif t <= 6.5e-52: tmp = -((x_m / z) / y) elif t <= 1e+212: tmp = (x_m / t) / y else: tmp = (x_m / -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 (t <= -2.4e-153) tmp = Float64(Float64(x_m / y) / t); elseif (t <= 6.5e-52) tmp = Float64(-Float64(Float64(x_m / z) / y)); elseif (t <= 1e+212) tmp = Float64(Float64(x_m / t) / y); else tmp = Float64(Float64(x_m / 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 (t <= -2.4e-153)
tmp = (x_m / y) / t;
elseif (t <= 6.5e-52)
tmp = -((x_m / z) / y);
elseif (t <= 1e+212)
tmp = (x_m / t) / y;
else
tmp = (x_m / -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[t, -2.4e-153], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 6.5e-52], (-N[(N[(x$95$m / z), $MachinePrecision] / y), $MachinePrecision]), If[LessEqual[t, 1e+212], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], N[(N[(x$95$m / (-t)), $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])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{-153}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-52}:\\
\;\;\;\;-\frac{\frac{x\_m}{z}}{y}\\
\mathbf{elif}\;t \leq 10^{+212}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{-t}}{z}\\
\end{array}
\end{array}
if t < -2.4000000000000002e-153Initial program 90.4%
Taylor expanded in y around inf 58.6%
associate-/r*58.6%
Simplified58.6%
Taylor expanded in t around inf 52.0%
if -2.4000000000000002e-153 < t < 6.5e-52Initial program 95.1%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around inf 62.8%
Taylor expanded in t around 0 54.0%
associate-*r/54.0%
neg-mul-154.0%
Simplified54.0%
if 6.5e-52 < t < 9.9999999999999991e211Initial program 92.2%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around inf 83.3%
Taylor expanded in y around inf 59.6%
if 9.9999999999999991e211 < t Initial program 91.6%
associate-/l/89.7%
Simplified89.7%
Taylor expanded in t around inf 89.7%
Taylor expanded in y around 0 65.9%
neg-mul-165.9%
Simplified65.9%
Final simplification55.2%
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) y)))
(*
x_s
(if (<= z -3.4e+74)
t_1
(if (<= z -4.5e-26)
(/ x_m (* z (- t)))
(if (<= z 3.4e+95) (/ x_m (* y t)) 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) / y;
double tmp;
if (z <= -3.4e+74) {
tmp = t_1;
} else if (z <= -4.5e-26) {
tmp = x_m / (z * -t);
} else if (z <= 3.4e+95) {
tmp = x_m / (y * t);
} 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) / y
if (z <= (-3.4d+74)) then
tmp = t_1
else if (z <= (-4.5d-26)) then
tmp = x_m / (z * -t)
else if (z <= 3.4d+95) then
tmp = x_m / (y * t)
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) / y;
double tmp;
if (z <= -3.4e+74) {
tmp = t_1;
} else if (z <= -4.5e-26) {
tmp = x_m / (z * -t);
} else if (z <= 3.4e+95) {
tmp = x_m / (y * t);
} 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) / y tmp = 0 if z <= -3.4e+74: tmp = t_1 elif z <= -4.5e-26: tmp = x_m / (z * -t) elif z <= 3.4e+95: tmp = x_m / (y * t) 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) / y) tmp = 0.0 if (z <= -3.4e+74) tmp = t_1; elseif (z <= -4.5e-26) tmp = Float64(x_m / Float64(z * Float64(-t))); elseif (z <= 3.4e+95) tmp = Float64(x_m / Float64(y * t)); 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) / y;
tmp = 0.0;
if (z <= -3.4e+74)
tmp = t_1;
elseif (z <= -4.5e-26)
tmp = x_m / (z * -t);
elseif (z <= 3.4e+95)
tmp = x_m / (y * t);
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] / y), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -3.4e+74], t$95$1, If[LessEqual[z, -4.5e-26], N[(x$95$m / N[(z * (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e+95], N[(x$95$m / N[(y * t), $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{\frac{x\_m}{z}}{y}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-26}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(-t\right)}\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+95}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -3.3999999999999999e74 or 3.40000000000000022e95 < z Initial program 84.2%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around inf 44.0%
Taylor expanded in t around 0 43.1%
associate-*r/43.1%
neg-mul-143.1%
Simplified43.1%
*-un-lft-identity43.1%
associate-/l/35.0%
add-sqr-sqrt19.5%
sqrt-unprod40.4%
sqr-neg40.4%
sqrt-unprod15.4%
add-sqr-sqrt34.9%
Applied egg-rr34.9%
*-lft-identity34.9%
associate-/r*32.1%
*-lft-identity32.1%
associate-*l/32.1%
associate-*r/40.3%
associate-*l/40.3%
*-lft-identity40.3%
Simplified40.3%
if -3.3999999999999999e74 < z < -4.4999999999999999e-26Initial program 90.0%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around inf 58.8%
Taylor expanded in y around 0 48.5%
associate-*r/48.5%
neg-mul-148.5%
Simplified48.5%
if -4.4999999999999999e-26 < z < 3.40000000000000022e95Initial program 99.1%
Taylor expanded in z around 0 68.5%
Final simplification55.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 (let* ((t_1 (* (- y z) (- t z)))) (* x_s (if (<= t_1 1e+308) (/ x_m t_1) (* (/ x_m (- y z)) (/ -1.0 z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= 1e+308) {
tmp = x_m / t_1;
} else {
tmp = (x_m / (y - z)) * (-1.0 / z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) * (t - z)
if (t_1 <= 1d+308) then
tmp = x_m / t_1
else
tmp = (x_m / (y - z)) * ((-1.0d0) / z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= 1e+308) {
tmp = x_m / t_1;
} else {
tmp = (x_m / (y - z)) * (-1.0 / z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if t_1 <= 1e+308: tmp = x_m / t_1 else: tmp = (x_m / (y - z)) * (-1.0 / z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (t_1 <= 1e+308) tmp = Float64(x_m / t_1); else tmp = Float64(Float64(x_m / Float64(y - z)) * Float64(-1.0 / z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = (y - z) * (t - z);
tmp = 0.0;
if (t_1 <= 1e+308)
tmp = x_m / t_1;
else
tmp = (x_m / (y - z)) * (-1.0 / z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, 1e+308], N[(x$95$m / t$95$1), $MachinePrecision], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq 10^{+308}:\\
\;\;\;\;\frac{x\_m}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y - z} \cdot \frac{-1}{z}\\
\end{array}
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < 1e308Initial program 97.6%
if 1e308 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 81.1%
associate-/r*99.8%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 96.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 (<= t -1.4e-218)
(/ (/ x_m (- t z)) y)
(if (<= t 46000.0) (* (/ x_m (- y z)) (/ -1.0 z)) (/ 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 <= -1.4e-218) {
tmp = (x_m / (t - z)) / y;
} else if (t <= 46000.0) {
tmp = (x_m / (y - z)) * (-1.0 / z);
} 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 <= (-1.4d-218)) then
tmp = (x_m / (t - z)) / y
else if (t <= 46000.0d0) then
tmp = (x_m / (y - z)) * ((-1.0d0) / z)
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 <= -1.4e-218) {
tmp = (x_m / (t - z)) / y;
} else if (t <= 46000.0) {
tmp = (x_m / (y - z)) * (-1.0 / z);
} 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 <= -1.4e-218: tmp = (x_m / (t - z)) / y elif t <= 46000.0: tmp = (x_m / (y - z)) * (-1.0 / z) 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 <= -1.4e-218) tmp = Float64(Float64(x_m / Float64(t - z)) / y); elseif (t <= 46000.0) tmp = Float64(Float64(x_m / Float64(y - z)) * Float64(-1.0 / z)); 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 <= -1.4e-218)
tmp = (x_m / (t - z)) / y;
elseif (t <= 46000.0)
tmp = (x_m / (y - z)) * (-1.0 / z);
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, -1.4e-218], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 46000.0], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / z), $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 -1.4 \cdot 10^{-218}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\
\mathbf{elif}\;t \leq 46000:\\
\;\;\;\;\frac{x\_m}{y - z} \cdot \frac{-1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -1.40000000000000004e-218Initial program 90.6%
associate-/l/95.7%
Simplified95.7%
Taylor expanded in y around inf 59.3%
if -1.40000000000000004e-218 < t < 46000Initial program 94.8%
associate-/r*94.6%
div-inv94.5%
Applied egg-rr94.5%
Taylor expanded in t around 0 85.1%
if 46000 < t Initial program 92.5%
Taylor expanded in t around inf 87.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 -1.15e+137) (not (<= z 1.5e-11)))
(/ (/ x_m z) (- z t))
(/ (/ x_m (- t z)) y))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1.15e+137) || !(z <= 1.5e-11)) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / (t - z)) / y;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.15d+137)) .or. (.not. (z <= 1.5d-11))) then
tmp = (x_m / z) / (z - t)
else
tmp = (x_m / (t - z)) / y
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1.15e+137) || !(z <= 1.5e-11)) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / (t - z)) / y;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -1.15e+137) or not (z <= 1.5e-11): tmp = (x_m / z) / (z - t) else: tmp = (x_m / (t - z)) / y return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -1.15e+137) || !(z <= 1.5e-11)) tmp = Float64(Float64(x_m / z) / Float64(z - t)); else tmp = Float64(Float64(x_m / Float64(t - z)) / y); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -1.15e+137) || ~((z <= 1.5e-11)))
tmp = (x_m / z) / (z - t);
else
tmp = (x_m / (t - z)) / y;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -1.15e+137], N[Not[LessEqual[z, 1.5e-11]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $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.15 \cdot 10^{+137} \lor \neg \left(z \leq 1.5 \cdot 10^{-11}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\
\end{array}
\end{array}
if z < -1.15e137 or 1.5e-11 < z Initial program 85.9%
Taylor expanded in y around 0 80.8%
mul-1-neg80.8%
associate-/r*92.0%
distribute-neg-frac292.0%
sub-neg92.0%
+-commutative92.0%
distribute-neg-in92.0%
remove-double-neg92.0%
unsub-neg92.0%
Simplified92.0%
if -1.15e137 < z < 1.5e-11Initial program 97.2%
associate-/l/94.8%
Simplified94.8%
Taylor expanded in y around inf 77.4%
Final simplification83.8%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -6.8e-56) (not (<= z 1.65e-24)))
(/ x_m (* z (- z y)))
(/ 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 <= -6.8e-56) || !(z <= 1.65e-24)) {
tmp = x_m / (z * (z - y));
} 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 <= (-6.8d-56)) .or. (.not. (z <= 1.65d-24))) then
tmp = x_m / (z * (z - y))
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 <= -6.8e-56) || !(z <= 1.65e-24)) {
tmp = x_m / (z * (z - y));
} 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 <= -6.8e-56) or not (z <= 1.65e-24): tmp = x_m / (z * (z - y)) 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 <= -6.8e-56) || !(z <= 1.65e-24)) tmp = Float64(x_m / Float64(z * Float64(z - y))); 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 <= -6.8e-56) || ~((z <= 1.65e-24)))
tmp = x_m / (z * (z - y));
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, -6.8e-56], N[Not[LessEqual[z, 1.65e-24]], $MachinePrecision]], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $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 -6.8 \cdot 10^{-56} \lor \neg \left(z \leq 1.65 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -6.79999999999999964e-56 or 1.64999999999999992e-24 < z Initial program 87.4%
Taylor expanded in t around 0 72.6%
mul-1-neg72.6%
distribute-rgt-neg-in72.6%
neg-sub072.6%
sub-neg72.6%
+-commutative72.6%
associate--r+72.6%
neg-sub072.6%
remove-double-neg72.6%
Simplified72.6%
if -6.79999999999999964e-56 < z < 1.64999999999999992e-24Initial program 99.0%
Taylor expanded in z around 0 72.6%
Final simplification72.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 (<= z -1.15e+137)
(/ (/ x_m z) (- z t))
(if (<= z 5.6e-11) (/ (/ x_m (- t z)) y) (/ (/ x_m (- 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 (z <= -1.15e+137) {
tmp = (x_m / z) / (z - t);
} else if (z <= 5.6e-11) {
tmp = (x_m / (t - z)) / y;
} else {
tmp = (x_m / (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 (z <= (-1.15d+137)) then
tmp = (x_m / z) / (z - t)
else if (z <= 5.6d-11) then
tmp = (x_m / (t - z)) / y
else
tmp = (x_m / (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 (z <= -1.15e+137) {
tmp = (x_m / z) / (z - t);
} else if (z <= 5.6e-11) {
tmp = (x_m / (t - z)) / y;
} else {
tmp = (x_m / (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 z <= -1.15e+137: tmp = (x_m / z) / (z - t) elif z <= 5.6e-11: tmp = (x_m / (t - z)) / y else: tmp = (x_m / (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 (z <= -1.15e+137) tmp = Float64(Float64(x_m / z) / Float64(z - t)); elseif (z <= 5.6e-11) tmp = Float64(Float64(x_m / Float64(t - z)) / y); else tmp = Float64(Float64(x_m / Float64(z - 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 (z <= -1.15e+137)
tmp = (x_m / z) / (z - t);
elseif (z <= 5.6e-11)
tmp = (x_m / (t - z)) / y;
else
tmp = (x_m / (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[z, -1.15e+137], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e-11], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x$95$m / N[(z - t), $MachinePrecision]), $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])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+137}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-11}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{z - t}}{z}\\
\end{array}
\end{array}
if z < -1.15e137Initial program 84.8%
Taylor expanded in y around 0 84.8%
mul-1-neg84.8%
associate-/r*99.2%
distribute-neg-frac299.2%
sub-neg99.2%
+-commutative99.2%
distribute-neg-in99.2%
remove-double-neg99.2%
unsub-neg99.2%
Simplified99.2%
if -1.15e137 < z < 5.6e-11Initial program 97.2%
associate-/l/94.8%
Simplified94.8%
Taylor expanded in y around inf 77.4%
if 5.6e-11 < z Initial program 86.7%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in y around 0 86.4%
neg-mul-186.4%
Simplified86.4%
Final simplification83.8%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -4.6e-181)
(/ (/ x_m y) (- t z))
(if (<= t 1.3e-51) (/ 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 <= -4.6e-181) {
tmp = (x_m / y) / (t - z);
} else if (t <= 1.3e-51) {
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 <= (-4.6d-181)) then
tmp = (x_m / y) / (t - z)
else if (t <= 1.3d-51) 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 <= -4.6e-181) {
tmp = (x_m / y) / (t - z);
} else if (t <= 1.3e-51) {
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 <= -4.6e-181: tmp = (x_m / y) / (t - z) elif t <= 1.3e-51: 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 <= -4.6e-181) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (t <= 1.3e-51) 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 <= -4.6e-181)
tmp = (x_m / y) / (t - z);
elseif (t <= 1.3e-51)
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, -4.6e-181], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e-51], 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 -4.6 \cdot 10^{-181}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-51}:\\
\;\;\;\;\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 < -4.59999999999999982e-181Initial program 90.2%
Taylor expanded in y around inf 58.1%
associate-/r*58.1%
Simplified58.1%
if -4.59999999999999982e-181 < t < 1.3e-51Initial program 95.9%
Taylor expanded in t around 0 86.1%
mul-1-neg86.1%
distribute-rgt-neg-in86.1%
neg-sub086.1%
sub-neg86.1%
+-commutative86.1%
associate--r+86.1%
neg-sub086.1%
remove-double-neg86.1%
Simplified86.1%
if 1.3e-51 < t Initial program 92.0%
Taylor expanded in t around inf 87.5%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -6e-129)
(/ 1.0 (* t (/ y x_m)))
(if (<= t 2.1e-52) (/ 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 <= -6e-129) {
tmp = 1.0 / (t * (y / x_m));
} else if (t <= 2.1e-52) {
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 <= (-6d-129)) then
tmp = 1.0d0 / (t * (y / x_m))
else if (t <= 2.1d-52) 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 <= -6e-129) {
tmp = 1.0 / (t * (y / x_m));
} else if (t <= 2.1e-52) {
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 <= -6e-129: tmp = 1.0 / (t * (y / x_m)) elif t <= 2.1e-52: 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 <= -6e-129) tmp = Float64(1.0 / Float64(t * Float64(y / x_m))); elseif (t <= 2.1e-52) 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 <= -6e-129)
tmp = 1.0 / (t * (y / x_m));
elseif (t <= 2.1e-52)
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, -6e-129], N[(1.0 / N[(t * N[(y / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e-52], 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 -6 \cdot 10^{-129}:\\
\;\;\;\;\frac{1}{t \cdot \frac{y}{x\_m}}\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-52}:\\
\;\;\;\;\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 < -5.9999999999999996e-129Initial program 90.0%
associate-/l/96.0%
clear-num95.4%
inv-pow95.4%
div-inv95.4%
clear-num95.7%
Applied egg-rr95.7%
unpow-195.7%
Simplified95.7%
Taylor expanded in z around 0 50.2%
associate-/l*50.2%
Simplified50.2%
if -5.9999999999999996e-129 < t < 2.0999999999999999e-52Initial program 95.4%
Taylor expanded in t around 0 82.5%
mul-1-neg82.5%
distribute-rgt-neg-in82.5%
neg-sub082.5%
sub-neg82.5%
+-commutative82.5%
associate--r+82.5%
neg-sub082.5%
remove-double-neg82.5%
Simplified82.5%
if 2.0999999999999999e-52 < t Initial program 92.0%
Taylor expanded in t around inf 87.5%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -3.3e+66) (not (<= z 1.08e+102)))
(/ (/ x_m z) y)
(/ (/ 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 <= -3.3e+66) || !(z <= 1.08e+102)) {
tmp = (x_m / z) / y;
} 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 <= (-3.3d+66)) .or. (.not. (z <= 1.08d+102))) then
tmp = (x_m / z) / y
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 <= -3.3e+66) || !(z <= 1.08e+102)) {
tmp = (x_m / z) / y;
} 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 <= -3.3e+66) or not (z <= 1.08e+102): tmp = (x_m / z) / y 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 <= -3.3e+66) || !(z <= 1.08e+102)) tmp = Float64(Float64(x_m / z) / y); else tmp = Float64(Float64(x_m / y) / t); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -3.3e+66) || ~((z <= 1.08e+102)))
tmp = (x_m / z) / y;
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, -3.3e+66], N[Not[LessEqual[z, 1.08e+102]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / y), $MachinePrecision], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+66} \lor \neg \left(z \leq 1.08 \cdot 10^{+102}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\end{array}
\end{array}
if z < -3.3000000000000001e66 or 1.08000000000000002e102 < z Initial program 83.9%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around inf 45.6%
Taylor expanded in t around 0 44.6%
associate-*r/44.6%
neg-mul-144.6%
Simplified44.6%
*-un-lft-identity44.6%
associate-/l/36.4%
add-sqr-sqrt19.7%
sqrt-unprod41.0%
sqr-neg41.0%
sqrt-unprod15.7%
add-sqr-sqrt34.6%
Applied egg-rr34.6%
*-lft-identity34.6%
associate-/r*31.8%
*-lft-identity31.8%
associate-*l/31.8%
associate-*r/40.1%
associate-*l/40.1%
*-lft-identity40.1%
Simplified40.1%
if -3.3000000000000001e66 < z < 1.08000000000000002e102Initial program 98.0%
Taylor expanded in y around inf 73.1%
associate-/r*71.2%
Simplified71.2%
Taylor expanded in t around inf 60.7%
Final simplification52.4%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -3e+66) (not (<= z 1.2e+101)))
(/ 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 <= -3e+66) || !(z <= 1.2e+101)) {
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 <= (-3d+66)) .or. (.not. (z <= 1.2d+101))) 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 <= -3e+66) || !(z <= 1.2e+101)) {
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 <= -3e+66) or not (z <= 1.2e+101): 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 <= -3e+66) || !(z <= 1.2e+101)) tmp = Float64(x_m / Float64(y * z)); else tmp = Float64(Float64(x_m / y) / t); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -3e+66) || ~((z <= 1.2e+101)))
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, -3e+66], N[Not[LessEqual[z, 1.2e+101]], $MachinePrecision]], N[(x$95$m / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+66} \lor \neg \left(z \leq 1.2 \cdot 10^{+101}\right):\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\end{array}
\end{array}
if z < -3.00000000000000002e66 or 1.19999999999999994e101 < z Initial program 83.9%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around inf 45.6%
Taylor expanded in t around 0 44.6%
associate-*r/44.6%
neg-mul-144.6%
Simplified44.6%
*-un-lft-identity44.6%
associate-/l/36.4%
add-sqr-sqrt19.7%
sqrt-unprod41.0%
sqr-neg41.0%
sqrt-unprod15.7%
add-sqr-sqrt34.6%
Applied egg-rr34.6%
*-lft-identity34.6%
*-commutative34.6%
Simplified34.6%
if -3.00000000000000002e66 < z < 1.19999999999999994e101Initial program 98.0%
Taylor expanded in y around inf 73.1%
associate-/r*71.2%
Simplified71.2%
Taylor expanded in t around inf 60.7%
Final simplification50.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 -1e+25) (not (<= z 6e+74))) (/ 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 <= -1e+25) || !(z <= 6e+74)) {
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 <= (-1d+25)) .or. (.not. (z <= 6d+74))) 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 <= -1e+25) || !(z <= 6e+74)) {
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 <= -1e+25) or not (z <= 6e+74): 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 <= -1e+25) || !(z <= 6e+74)) 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 <= -1e+25) || ~((z <= 6e+74)))
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, -1e+25], N[Not[LessEqual[z, 6e+74]], $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 -1 \cdot 10^{+25} \lor \neg \left(z \leq 6 \cdot 10^{+74}\right):\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.00000000000000009e25 or 6e74 < z Initial program 84.4%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around inf 46.0%
Taylor expanded in t around 0 43.5%
associate-*r/43.5%
neg-mul-143.5%
Simplified43.5%
*-un-lft-identity43.5%
associate-/l/36.3%
add-sqr-sqrt19.1%
sqrt-unprod38.6%
sqr-neg38.6%
sqrt-unprod15.6%
add-sqr-sqrt33.0%
Applied egg-rr33.0%
*-lft-identity33.0%
*-commutative33.0%
Simplified33.0%
if -1.00000000000000009e25 < z < 6e74Initial program 99.1%
Taylor expanded in z around 0 65.0%
Final simplification50.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 (/ 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 92.3%
Taylor expanded in z around 0 42.9%
Final simplification42.9%
(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 2024180
(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))))