
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x_s x_m y z t) :precision binary64 (let* ((t_1 (/ x_m (* (- y z) (- t z))))) (* x_s (if (<= t_1 -1e-243) t_1 (/ (/ x_m (- z 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 t_1 = x_m / ((y - z) * (t - z));
double tmp;
if (t_1 <= -1e-243) {
tmp = t_1;
} else {
tmp = (x_m / (z - 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) :: t_1
real(8) :: tmp
t_1 = x_m / ((y - z) * (t - z))
if (t_1 <= (-1d-243)) then
tmp = t_1
else
tmp = (x_m / (z - 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 t_1 = x_m / ((y - z) * (t - z));
double tmp;
if (t_1 <= -1e-243) {
tmp = t_1;
} else {
tmp = (x_m / (z - 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): t_1 = x_m / ((y - z) * (t - z)) tmp = 0 if t_1 <= -1e-243: tmp = t_1 else: tmp = (x_m / (z - 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) t_1 = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))) tmp = 0.0 if (t_1 <= -1e-243) tmp = t_1; else tmp = Float64(Float64(x_m / Float64(z - t)) / Float64(z - y)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = x_m / ((y - z) * (t - z));
tmp = 0.0;
if (t_1 <= -1e-243)
tmp = t_1;
else
tmp = (x_m / (z - 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_] := Block[{t$95$1 = N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, -1e-243], t$95$1, N[(N[(x$95$m / N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-243}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{z - t}}{z - y}\\
\end{array}
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -9.99999999999999995e-244Initial program 96.0%
if -9.99999999999999995e-244 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 86.1%
Simplified0
Applied egg-rr0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -82000000000000.0)
(/ (/ x_m y) (- t z))
(if (<= y -1.32e-76)
(/ (/ x_m z) (- z y))
(if (<= y -7.5e-79)
(/ x_m (* t y))
(if (<= y 2.7e-101) (/ (/ x_m z) (- z t)) (/ (/ x_m t) (- y z))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -82000000000000.0) {
tmp = (x_m / y) / (t - z);
} else if (y <= -1.32e-76) {
tmp = (x_m / z) / (z - y);
} else if (y <= -7.5e-79) {
tmp = x_m / (t * y);
} else if (y <= 2.7e-101) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-82000000000000.0d0)) then
tmp = (x_m / y) / (t - z)
else if (y <= (-1.32d-76)) then
tmp = (x_m / z) / (z - y)
else if (y <= (-7.5d-79)) then
tmp = x_m / (t * y)
else if (y <= 2.7d-101) then
tmp = (x_m / z) / (z - t)
else
tmp = (x_m / t) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -82000000000000.0) {
tmp = (x_m / y) / (t - z);
} else if (y <= -1.32e-76) {
tmp = (x_m / z) / (z - y);
} else if (y <= -7.5e-79) {
tmp = x_m / (t * y);
} else if (y <= 2.7e-101) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -82000000000000.0: tmp = (x_m / y) / (t - z) elif y <= -1.32e-76: tmp = (x_m / z) / (z - y) elif y <= -7.5e-79: tmp = x_m / (t * y) elif y <= 2.7e-101: tmp = (x_m / z) / (z - t) else: tmp = (x_m / t) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -82000000000000.0) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= -1.32e-76) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (y <= -7.5e-79) tmp = Float64(x_m / Float64(t * y)); elseif (y <= 2.7e-101) tmp = Float64(Float64(x_m / z) / Float64(z - t)); else tmp = Float64(Float64(x_m / t) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (y <= -82000000000000.0)
tmp = (x_m / y) / (t - z);
elseif (y <= -1.32e-76)
tmp = (x_m / z) / (z - y);
elseif (y <= -7.5e-79)
tmp = x_m / (t * y);
elseif (y <= 2.7e-101)
tmp = (x_m / z) / (z - t);
else
tmp = (x_m / t) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -82000000000000.0], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.32e-76], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.5e-79], N[(x$95$m / N[(t * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e-101], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -82000000000000:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq -1.32 \cdot 10^{-76}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;y \leq -7.5 \cdot 10^{-79}:\\
\;\;\;\;\frac{x\_m}{t \cdot y}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-101}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -8.2e13Initial program 90.8%
Simplified0
Taylor expanded in y around inf 0
Simplified0
if -8.2e13 < y < -1.31999999999999996e-76Initial program 95.6%
Simplified0
Taylor expanded in z around inf 0
Simplified0
Applied egg-rr0
if -1.31999999999999996e-76 < y < -7.49999999999999969e-79Initial program 100.0%
Simplified0
Taylor expanded in z around 0 0
Simplified0
if -7.49999999999999969e-79 < y < 2.7000000000000002e-101Initial program 92.9%
Simplified0
Taylor expanded in y around 0 0
Simplified0
Applied egg-rr0
if 2.7000000000000002e-101 < y Initial program 78.9%
Simplified0
Taylor expanded in t around inf 0
Simplified0
Applied egg-rr0
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 -4.3e-100)
(/ x_m (* y (- t z)))
(if (<= y 1.12e-256)
(/ (/ x_m z) z)
(if (<= y 5e+44) (/ x_m (* t (- y 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 (y <= -4.3e-100) {
tmp = x_m / (y * (t - z));
} else if (y <= 1.12e-256) {
tmp = (x_m / z) / z;
} else if (y <= 5e+44) {
tmp = x_m / (t * (y - 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 (y <= (-4.3d-100)) then
tmp = x_m / (y * (t - z))
else if (y <= 1.12d-256) then
tmp = (x_m / z) / z
else if (y <= 5d+44) then
tmp = x_m / (t * (y - 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 (y <= -4.3e-100) {
tmp = x_m / (y * (t - z));
} else if (y <= 1.12e-256) {
tmp = (x_m / z) / z;
} else if (y <= 5e+44) {
tmp = x_m / (t * (y - 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 y <= -4.3e-100: tmp = x_m / (y * (t - z)) elif y <= 1.12e-256: tmp = (x_m / z) / z elif y <= 5e+44: tmp = x_m / (t * (y - 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 (y <= -4.3e-100) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (y <= 1.12e-256) tmp = Float64(Float64(x_m / z) / z); elseif (y <= 5e+44) tmp = Float64(x_m / Float64(t * Float64(y - 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 (y <= -4.3e-100)
tmp = x_m / (y * (t - z));
elseif (y <= 1.12e-256)
tmp = (x_m / z) / z;
elseif (y <= 5e+44)
tmp = x_m / (t * (y - 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[LessEqual[y, -4.3e-100], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.12e-256], N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 5e+44], N[(x$95$m / N[(t * N[(y - z), $MachinePrecision]), $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}\;y \leq -4.3 \cdot 10^{-100}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{-256}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+44}:\\
\;\;\;\;\frac{x\_m}{t \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if y < -4.29999999999999998e-100Initial program 91.8%
Simplified0
Taylor expanded in y around inf 0
Simplified0
if -4.29999999999999998e-100 < y < 1.12e-256Initial program 93.1%
Simplified0
Taylor expanded in z around inf 0
Simplified0
Applied egg-rr0
if 1.12e-256 < y < 4.9999999999999996e44Initial program 91.7%
Simplified0
Taylor expanded in t around inf 0
Simplified0
if 4.9999999999999996e44 < y Initial program 69.8%
Simplified0
Taylor expanded in z around 0 0
Simplified0
Applied egg-rr0
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.5e-24)
(/ (/ x_m y) (- t z))
(if (<= y 3.9e-100) (/ (/ x_m z) (- z t)) (/ (/ x_m t) (- y z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -6.5e-24) {
tmp = (x_m / y) / (t - z);
} else if (y <= 3.9e-100) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-6.5d-24)) then
tmp = (x_m / y) / (t - z)
else if (y <= 3.9d-100) then
tmp = (x_m / z) / (z - t)
else
tmp = (x_m / t) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -6.5e-24) {
tmp = (x_m / y) / (t - z);
} else if (y <= 3.9e-100) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -6.5e-24: tmp = (x_m / y) / (t - z) elif y <= 3.9e-100: tmp = (x_m / z) / (z - t) else: tmp = (x_m / t) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -6.5e-24) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= 3.9e-100) tmp = Float64(Float64(x_m / z) / Float64(z - t)); else tmp = Float64(Float64(x_m / t) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (y <= -6.5e-24)
tmp = (x_m / y) / (t - z);
elseif (y <= 3.9e-100)
tmp = (x_m / z) / (z - t);
else
tmp = (x_m / t) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -6.5e-24], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e-100], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{-24}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-100}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -6.5e-24Initial program 90.4%
Simplified0
Taylor expanded in y around inf 0
Simplified0
if -6.5e-24 < y < 3.89999999999999977e-100Initial program 93.9%
Simplified0
Taylor expanded in y around 0 0
Simplified0
Applied egg-rr0
if 3.89999999999999977e-100 < y Initial program 78.9%
Simplified0
Taylor expanded in t around inf 0
Simplified0
Applied egg-rr0
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 -3.1e-27)
(/ (/ x_m y) (- t z))
(if (<= y 4.6e-256) (/ x_m (* z (- z t))) (/ (/ x_m t) (- y z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -3.1e-27) {
tmp = (x_m / y) / (t - z);
} else if (y <= 4.6e-256) {
tmp = x_m / (z * (z - t));
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.1d-27)) then
tmp = (x_m / y) / (t - z)
else if (y <= 4.6d-256) then
tmp = x_m / (z * (z - t))
else
tmp = (x_m / t) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -3.1e-27) {
tmp = (x_m / y) / (t - z);
} else if (y <= 4.6e-256) {
tmp = x_m / (z * (z - t));
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -3.1e-27: tmp = (x_m / y) / (t - z) elif y <= 4.6e-256: tmp = x_m / (z * (z - t)) else: tmp = (x_m / t) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -3.1e-27) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= 4.6e-256) tmp = Float64(x_m / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x_m / t) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (y <= -3.1e-27)
tmp = (x_m / y) / (t - z);
elseif (y <= 4.6e-256)
tmp = x_m / (z * (z - t));
else
tmp = (x_m / t) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -3.1e-27], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e-256], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-27}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{-256}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -3.0999999999999998e-27Initial program 90.4%
Simplified0
Taylor expanded in y around inf 0
Simplified0
if -3.0999999999999998e-27 < y < 4.6e-256Initial program 93.9%
Simplified0
Taylor expanded in y around 0 0
Simplified0
if 4.6e-256 < y Initial program 83.2%
Simplified0
Taylor expanded in t around inf 0
Simplified0
Applied egg-rr0
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 -3.6e-51)
(/ x_m (* y (- t z)))
(if (<= y 4.6e-256) (/ x_m (* z (- z t))) (/ (/ x_m t) (- y z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -3.6e-51) {
tmp = x_m / (y * (t - z));
} else if (y <= 4.6e-256) {
tmp = x_m / (z * (z - t));
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.6d-51)) then
tmp = x_m / (y * (t - z))
else if (y <= 4.6d-256) then
tmp = x_m / (z * (z - t))
else
tmp = (x_m / t) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -3.6e-51) {
tmp = x_m / (y * (t - z));
} else if (y <= 4.6e-256) {
tmp = x_m / (z * (z - t));
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -3.6e-51: tmp = x_m / (y * (t - z)) elif y <= 4.6e-256: tmp = x_m / (z * (z - t)) else: tmp = (x_m / t) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -3.6e-51) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (y <= 4.6e-256) tmp = Float64(x_m / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x_m / t) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (y <= -3.6e-51)
tmp = x_m / (y * (t - z));
elseif (y <= 4.6e-256)
tmp = x_m / (z * (z - t));
else
tmp = (x_m / t) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -3.6e-51], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e-256], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{-51}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{-256}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -3.6e-51Initial program 91.6%
Simplified0
Taylor expanded in y around inf 0
Simplified0
if -3.6e-51 < y < 4.6e-256Initial program 93.1%
Simplified0
Taylor expanded in y around 0 0
Simplified0
if 4.6e-256 < y Initial program 83.2%
Simplified0
Taylor expanded in t around inf 0
Simplified0
Applied egg-rr0
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 -6e-51)
(/ x_m (* y (- t z)))
(if (<= y 2.7e-52) (/ x_m (* z (- z t))) (/ (/ 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 (y <= -6e-51) {
tmp = x_m / (y * (t - z));
} else if (y <= 2.7e-52) {
tmp = x_m / (z * (z - t));
} 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 (y <= (-6d-51)) then
tmp = x_m / (y * (t - z))
else if (y <= 2.7d-52) then
tmp = x_m / (z * (z - t))
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 (y <= -6e-51) {
tmp = x_m / (y * (t - z));
} else if (y <= 2.7e-52) {
tmp = x_m / (z * (z - t));
} 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 y <= -6e-51: tmp = x_m / (y * (t - z)) elif y <= 2.7e-52: tmp = x_m / (z * (z - t)) 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 (y <= -6e-51) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (y <= 2.7e-52) tmp = Float64(x_m / Float64(z * Float64(z - t))); 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 (y <= -6e-51)
tmp = x_m / (y * (t - z));
elseif (y <= 2.7e-52)
tmp = x_m / (z * (z - t));
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[LessEqual[y, -6e-51], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e-52], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $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}\;y \leq -6 \cdot 10^{-51}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-52}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if y < -6.00000000000000005e-51Initial program 91.6%
Simplified0
Taylor expanded in y around inf 0
Simplified0
if -6.00000000000000005e-51 < y < 2.70000000000000009e-52Initial program 92.5%
Simplified0
Taylor expanded in y around 0 0
Simplified0
if 2.70000000000000009e-52 < y Initial program 77.5%
Simplified0
Taylor expanded in z around 0 0
Simplified0
Applied egg-rr0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (/ x_m z) z)))
(*
x_s
(if (<= z -130000000.0)
t_1
(if (<= z 5.5e+23) (/ x_m (* t (- y z))) t_1)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / z) / z;
double tmp;
if (z <= -130000000.0) {
tmp = t_1;
} else if (z <= 5.5e+23) {
tmp = x_m / (t * (y - z));
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x_m / z) / z
if (z <= (-130000000.0d0)) then
tmp = t_1
else if (z <= 5.5d+23) then
tmp = x_m / (t * (y - z))
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / z) / z;
double tmp;
if (z <= -130000000.0) {
tmp = t_1;
} else if (z <= 5.5e+23) {
tmp = x_m / (t * (y - z));
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = (x_m / z) / z tmp = 0 if z <= -130000000.0: tmp = t_1 elif z <= 5.5e+23: tmp = x_m / (t * (y - z)) else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(x_m / z) / z) tmp = 0.0 if (z <= -130000000.0) tmp = t_1; elseif (z <= 5.5e+23) tmp = Float64(x_m / Float64(t * Float64(y - z))); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = (x_m / z) / z;
tmp = 0.0;
if (z <= -130000000.0)
tmp = t_1;
elseif (z <= 5.5e+23)
tmp = x_m / (t * (y - z));
else
tmp = t_1;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -130000000.0], t$95$1, If[LessEqual[z, 5.5e+23], N[(x$95$m / N[(t * N[(y - z), $MachinePrecision]), $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}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -130000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+23}:\\
\;\;\;\;\frac{x\_m}{t \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -1.3e8 or 5.50000000000000004e23 < z Initial program 86.0%
Simplified0
Taylor expanded in z around inf 0
Simplified0
Applied egg-rr0
if -1.3e8 < z < 5.50000000000000004e23Initial program 89.9%
Simplified0
Taylor expanded in t around inf 0
Simplified0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (/ x_m z) z)))
(*
x_s
(if (<= z -95000000.0) t_1 (if (<= z 6.5e+27) (/ (/ 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) / z;
double tmp;
if (z <= -95000000.0) {
tmp = t_1;
} else if (z <= 6.5e+27) {
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) / z
if (z <= (-95000000.0d0)) then
tmp = t_1
else if (z <= 6.5d+27) 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) / z;
double tmp;
if (z <= -95000000.0) {
tmp = t_1;
} else if (z <= 6.5e+27) {
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) / z tmp = 0 if z <= -95000000.0: tmp = t_1 elif z <= 6.5e+27: 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) / z) tmp = 0.0 if (z <= -95000000.0) tmp = t_1; elseif (z <= 6.5e+27) tmp = Float64(Float64(x_m / 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) / z;
tmp = 0.0;
if (z <= -95000000.0)
tmp = t_1;
elseif (z <= 6.5e+27)
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] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -95000000.0], t$95$1, If[LessEqual[z, 6.5e+27], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], t$95$1]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -95000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+27}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -9.5e7 or 6.5000000000000005e27 < z Initial program 86.0%
Simplified0
Taylor expanded in z around inf 0
Simplified0
Applied egg-rr0
if -9.5e7 < z < 6.5000000000000005e27Initial program 89.9%
Simplified0
Taylor expanded in z around 0 0
Simplified0
Applied egg-rr0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ x_m (* z z))))
(*
x_s
(if (<= z -115000000.0) t_1 (if (<= z 2.55e+23) (/ (/ 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 * z);
double tmp;
if (z <= -115000000.0) {
tmp = t_1;
} else if (z <= 2.55e+23) {
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 * z)
if (z <= (-115000000.0d0)) then
tmp = t_1
else if (z <= 2.55d+23) 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 * z);
double tmp;
if (z <= -115000000.0) {
tmp = t_1;
} else if (z <= 2.55e+23) {
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 * z) tmp = 0 if z <= -115000000.0: tmp = t_1 elif z <= 2.55e+23: 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(x_m / Float64(z * z)) tmp = 0.0 if (z <= -115000000.0) tmp = t_1; elseif (z <= 2.55e+23) tmp = Float64(Float64(x_m / 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 * z);
tmp = 0.0;
if (z <= -115000000.0)
tmp = t_1;
elseif (z <= 2.55e+23)
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[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -115000000.0], t$95$1, If[LessEqual[z, 2.55e+23], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], t$95$1]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z \cdot z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -115000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{+23}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -1.15e8 or 2.5500000000000001e23 < z Initial program 86.0%
Simplified0
Taylor expanded in z around inf 0
Simplified0
if -1.15e8 < z < 2.5500000000000001e23Initial program 89.9%
Simplified0
Taylor expanded in z around 0 0
Simplified0
Applied egg-rr0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ x_m (* z z))))
(*
x_s
(if (<= z -100000000.0) t_1 (if (<= z 8.4e+21) (/ (/ x_m t) y) t_1)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (z * z);
double tmp;
if (z <= -100000000.0) {
tmp = t_1;
} else if (z <= 8.4e+21) {
tmp = (x_m / t) / y;
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x_m / (z * z)
if (z <= (-100000000.0d0)) then
tmp = t_1
else if (z <= 8.4d+21) then
tmp = (x_m / t) / y
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (z * z);
double tmp;
if (z <= -100000000.0) {
tmp = t_1;
} else if (z <= 8.4e+21) {
tmp = (x_m / t) / y;
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = x_m / (z * z) tmp = 0 if z <= -100000000.0: tmp = t_1 elif z <= 8.4e+21: tmp = (x_m / t) / y else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m / Float64(z * z)) tmp = 0.0 if (z <= -100000000.0) tmp = t_1; elseif (z <= 8.4e+21) tmp = Float64(Float64(x_m / t) / y); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = x_m / (z * z);
tmp = 0.0;
if (z <= -100000000.0)
tmp = t_1;
elseif (z <= 8.4e+21)
tmp = (x_m / t) / y;
else
tmp = t_1;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -100000000.0], t$95$1, If[LessEqual[z, 8.4e+21], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], t$95$1]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z \cdot z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -100000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.4 \cdot 10^{+21}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -1e8 or 8.4e21 < z Initial program 86.0%
Simplified0
Taylor expanded in z around inf 0
Simplified0
if -1e8 < z < 8.4e21Initial program 89.9%
Simplified0
Taylor expanded in z around 0 0
Simplified0
Applied egg-rr0
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x_s x_m y z t) :precision binary64 (let* ((t_1 (/ x_m (* z z)))) (* x_s (if (<= z -95000000.0) t_1 (if (<= z 4e-38) (/ x_m (* t y)) t_1)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (z * z);
double tmp;
if (z <= -95000000.0) {
tmp = t_1;
} else if (z <= 4e-38) {
tmp = x_m / (t * y);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x_m / (z * z)
if (z <= (-95000000.0d0)) then
tmp = t_1
else if (z <= 4d-38) then
tmp = x_m / (t * y)
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (z * z);
double tmp;
if (z <= -95000000.0) {
tmp = t_1;
} else if (z <= 4e-38) {
tmp = x_m / (t * y);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = x_m / (z * z) tmp = 0 if z <= -95000000.0: tmp = t_1 elif z <= 4e-38: tmp = x_m / (t * y) else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m / Float64(z * z)) tmp = 0.0 if (z <= -95000000.0) tmp = t_1; elseif (z <= 4e-38) tmp = Float64(x_m / Float64(t * y)); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = x_m / (z * z);
tmp = 0.0;
if (z <= -95000000.0)
tmp = t_1;
elseif (z <= 4e-38)
tmp = x_m / (t * y);
else
tmp = t_1;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -95000000.0], t$95$1, If[LessEqual[z, 4e-38], N[(x$95$m / N[(t * y), $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z \cdot z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -95000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-38}:\\
\;\;\;\;\frac{x\_m}{t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -9.5e7 or 3.9999999999999998e-38 < z Initial program 87.3%
Simplified0
Taylor expanded in z around inf 0
Simplified0
if -9.5e7 < z < 3.9999999999999998e-38Initial program 89.2%
Simplified0
Taylor expanded in z around 0 0
Simplified0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t 8.4e+168)
(/ x_m (* (- y z) (- t z)))
(/ (/ -1.0 t) (/ (- z y) x_m)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 8.4e+168) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (-1.0 / t) / ((z - y) / x_m);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 8.4d+168) then
tmp = x_m / ((y - z) * (t - z))
else
tmp = ((-1.0d0) / t) / ((z - y) / x_m)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 8.4e+168) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (-1.0 / t) / ((z - y) / x_m);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if t <= 8.4e+168: tmp = x_m / ((y - z) * (t - z)) else: tmp = (-1.0 / t) / ((z - y) / x_m) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= 8.4e+168) tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(Float64(-1.0 / t) / Float64(Float64(z - y) / x_m)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (t <= 8.4e+168)
tmp = x_m / ((y - z) * (t - z));
else
tmp = (-1.0 / t) / ((z - y) / x_m);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, 8.4e+168], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / t), $MachinePrecision] / N[(N[(z - y), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq 8.4 \cdot 10^{+168}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-1}{t}}{\frac{z - y}{x\_m}}\\
\end{array}
\end{array}
if t < 8.40000000000000011e168Initial program 90.3%
if 8.40000000000000011e168 < t Initial program 69.4%
Simplified0
Applied egg-rr0
Taylor expanded in z around 0 0
Simplified0
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.5e+140) (/ x_m (* (- y z) (- t z))) (/ (/ x_m t) (- y z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 9.5e+140) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 9.5d+140) then
tmp = x_m / ((y - z) * (t - z))
else
tmp = (x_m / t) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 9.5e+140) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if t <= 9.5e+140: tmp = x_m / ((y - z) * (t - z)) else: tmp = (x_m / t) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= 9.5e+140) tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(Float64(x_m / t) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (t <= 9.5e+140)
tmp = x_m / ((y - z) * (t - z));
else
tmp = (x_m / t) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, 9.5e+140], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq 9.5 \cdot 10^{+140}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < 9.4999999999999994e140Initial program 90.5%
if 9.4999999999999994e140 < t Initial program 69.3%
Simplified0
Taylor expanded in t around inf 0
Simplified0
Applied egg-rr0
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 (* 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) {
return x_s * (x_m / (t * y));
}
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 / (t * y))
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 / (t * y));
}
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 / (t * y))
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(t * y))) 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 / (t * y));
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[(t * y), $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}{t \cdot y}
\end{array}
Initial program 88.2%
Simplified0
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t z)))) (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) * (t - z)
if ((x / t_1) < 0.0d0) then
tmp = (x / (y - z)) / (t - z)
else
tmp = x * (1.0d0 / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if (x / t_1) < 0.0: tmp = (x / (y - z)) / (t - z) else: tmp = x * (1.0 / t_1) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (Float64(x / t_1) < 0.0) tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); else tmp = Float64(x * Float64(1.0 / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - z); tmp = 0.0; if ((x / t_1) < 0.0) tmp = (x / (y - z)) / (t - z); else tmp = x * (1.0 / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;\frac{x}{t\_1} < 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024110
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:alt
(if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))
(/ x (* (- y z) (- t z))))