
(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 22 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 (* (- t z) (- y z))))) (* x_s (if (<= t_1 -2e-309) t_1 (/ (/ x_m (- t z)) (- y z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / ((t - z) * (y - z));
double tmp;
if (t_1 <= -2e-309) {
tmp = t_1;
} else {
tmp = (x_m / (t - z)) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x_m / ((t - z) * (y - z))
if (t_1 <= (-2d-309)) then
tmp = t_1
else
tmp = (x_m / (t - z)) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / ((t - z) * (y - z));
double tmp;
if (t_1 <= -2e-309) {
tmp = t_1;
} else {
tmp = (x_m / (t - z)) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = x_m / ((t - z) * (y - z)) tmp = 0 if t_1 <= -2e-309: tmp = t_1 else: tmp = (x_m / (t - z)) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m / Float64(Float64(t - z) * Float64(y - z))) tmp = 0.0 if (t_1 <= -2e-309) tmp = t_1; else tmp = Float64(Float64(x_m / Float64(t - z)) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = x_m / ((t - z) * (y - z));
tmp = 0.0;
if (t_1 <= -2e-309)
tmp = t_1;
else
tmp = (x_m / (t - z)) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, -2e-309], t$95$1, N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{\left(t - z\right) \cdot \left(y - z\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-309}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y - z}\\
\end{array}
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -1.9999999999999988e-309Initial program 99.6%
if -1.9999999999999988e-309 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 82.2%
associate-/l/98.7%
Simplified98.7%
Final simplification98.9%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* (- t z) (- y z))))
(*
x_s
(if (<= t_1 -5e+296)
(/ (/ x_m (- y z)) t)
(if (<= t_1 2e+287) (/ x_m t_1) (/ (/ 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 t_1 = (t - z) * (y - z);
double tmp;
if (t_1 <= -5e+296) {
tmp = (x_m / (y - z)) / t;
} else if (t_1 <= 2e+287) {
tmp = x_m / t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (t - z) * (y - z)
if (t_1 <= (-5d+296)) then
tmp = (x_m / (y - z)) / t
else if (t_1 <= 2d+287) then
tmp = x_m / t_1
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 t_1 = (t - z) * (y - z);
double tmp;
if (t_1 <= -5e+296) {
tmp = (x_m / (y - z)) / t;
} else if (t_1 <= 2e+287) {
tmp = x_m / t_1;
} 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): t_1 = (t - z) * (y - z) tmp = 0 if t_1 <= -5e+296: tmp = (x_m / (y - z)) / t elif t_1 <= 2e+287: tmp = x_m / t_1 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) t_1 = Float64(Float64(t - z) * Float64(y - z)) tmp = 0.0 if (t_1 <= -5e+296) tmp = Float64(Float64(x_m / Float64(y - z)) / t); elseif (t_1 <= 2e+287) tmp = Float64(x_m / t_1); 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)
t_1 = (t - z) * (y - z);
tmp = 0.0;
if (t_1 <= -5e+296)
tmp = (x_m / (y - z)) / t;
elseif (t_1 <= 2e+287)
tmp = x_m / t_1;
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_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, -5e+296], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$1, 2e+287], N[(x$95$m / t$95$1), $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])\\
\\
\begin{array}{l}
t_1 := \left(t - z\right) \cdot \left(y - z\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+296}:\\
\;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+287}:\\
\;\;\;\;\frac{x\_m}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{z - t}}{z}\\
\end{array}
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -5.0000000000000001e296Initial program 57.1%
Taylor expanded in x around 0 57.1%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 84.4%
if -5.0000000000000001e296 < (*.f64 (-.f64 y z) (-.f64 t z)) < 2.0000000000000002e287Initial program 98.4%
if 2.0000000000000002e287 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 75.8%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in y around 0 85.3%
neg-mul-185.3%
Simplified85.3%
Final simplification92.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
(let* ((t_1 (/ (/ x_m z) z)))
(*
x_s
(if (<= z -6e+34)
t_1
(if (<= z -5.8e-38)
(/ (/ x_m z) (- y))
(if (<= z 3e-77)
(/ (/ x_m t) y)
(if (<= z 2.2e+172) (/ x_m (* z (- 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 / z) / z;
double tmp;
if (z <= -6e+34) {
tmp = t_1;
} else if (z <= -5.8e-38) {
tmp = (x_m / z) / -y;
} else if (z <= 3e-77) {
tmp = (x_m / t) / y;
} else if (z <= 2.2e+172) {
tmp = x_m / (z * (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 / z) / z
if (z <= (-6d+34)) then
tmp = t_1
else if (z <= (-5.8d-38)) then
tmp = (x_m / z) / -y
else if (z <= 3d-77) then
tmp = (x_m / t) / y
else if (z <= 2.2d+172) then
tmp = x_m / (z * (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 / z) / z;
double tmp;
if (z <= -6e+34) {
tmp = t_1;
} else if (z <= -5.8e-38) {
tmp = (x_m / z) / -y;
} else if (z <= 3e-77) {
tmp = (x_m / t) / y;
} else if (z <= 2.2e+172) {
tmp = x_m / (z * (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 / z) / z tmp = 0 if z <= -6e+34: tmp = t_1 elif z <= -5.8e-38: tmp = (x_m / z) / -y elif z <= 3e-77: tmp = (x_m / t) / y elif z <= 2.2e+172: tmp = x_m / (z * (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 / z) / z) tmp = 0.0 if (z <= -6e+34) tmp = t_1; elseif (z <= -5.8e-38) tmp = Float64(Float64(x_m / z) / Float64(-y)); elseif (z <= 3e-77) tmp = Float64(Float64(x_m / t) / y); elseif (z <= 2.2e+172) tmp = Float64(x_m / Float64(z * Float64(z - 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 <= -6e+34)
tmp = t_1;
elseif (z <= -5.8e-38)
tmp = (x_m / z) / -y;
elseif (z <= 3e-77)
tmp = (x_m / t) / y;
elseif (z <= 2.2e+172)
tmp = x_m / (z * (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 / z), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -6e+34], t$95$1, If[LessEqual[z, -5.8e-38], N[(N[(x$95$m / z), $MachinePrecision] / (-y)), $MachinePrecision], If[LessEqual[z, 3e-77], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 2.2e+172], N[(x$95$m / N[(z * N[(z - t), $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 -6 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-38}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{-y}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-77}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+172}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -6.00000000000000037e34 or 2.2000000000000001e172 < z Initial program 79.1%
Taylor expanded in t around 0 75.0%
mul-1-neg75.0%
associate-/r*91.6%
distribute-neg-frac291.6%
neg-sub091.6%
sub-neg91.6%
+-commutative91.6%
associate--r+91.6%
neg-sub091.6%
remove-double-neg91.6%
Simplified91.6%
Taylor expanded in z around inf 86.3%
if -6.00000000000000037e34 < z < -5.79999999999999988e-38Initial program 94.1%
Taylor expanded in t around 0 63.1%
mul-1-neg63.1%
associate-/r*68.9%
distribute-neg-frac268.9%
neg-sub068.9%
sub-neg68.9%
+-commutative68.9%
associate--r+68.9%
neg-sub068.9%
remove-double-neg68.9%
Simplified68.9%
Taylor expanded in z around 0 47.0%
neg-mul-147.0%
Simplified47.0%
if -5.79999999999999988e-38 < z < 3.00000000000000016e-77Initial program 91.1%
clear-num90.2%
associate-/r/91.1%
Applied egg-rr91.1%
*-commutative91.1%
associate-*r/91.1%
frac-times93.7%
clear-num92.7%
associate-*l/92.7%
*-un-lft-identity92.7%
Applied egg-rr92.7%
Taylor expanded in z around 0 65.6%
associate-/r*70.6%
Simplified70.6%
if 3.00000000000000016e-77 < z < 2.2000000000000001e172Initial program 91.2%
Taylor expanded in y around 0 65.7%
mul-1-neg65.7%
distribute-rgt-neg-in65.7%
sub-neg65.7%
+-commutative65.7%
distribute-neg-in65.7%
remove-double-neg65.7%
unsub-neg65.7%
Simplified65.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (/ x_m z) z)))
(*
x_s
(if (<= z -8.2e+111)
t_1
(if (<= z 7.5e-78)
(/ (/ x_m y) (- t z))
(if (<= z 2.2e+172) (/ x_m (* z (- 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 / z) / z;
double tmp;
if (z <= -8.2e+111) {
tmp = t_1;
} else if (z <= 7.5e-78) {
tmp = (x_m / y) / (t - z);
} else if (z <= 2.2e+172) {
tmp = x_m / (z * (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 / z) / z
if (z <= (-8.2d+111)) then
tmp = t_1
else if (z <= 7.5d-78) then
tmp = (x_m / y) / (t - z)
else if (z <= 2.2d+172) then
tmp = x_m / (z * (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 / z) / z;
double tmp;
if (z <= -8.2e+111) {
tmp = t_1;
} else if (z <= 7.5e-78) {
tmp = (x_m / y) / (t - z);
} else if (z <= 2.2e+172) {
tmp = x_m / (z * (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 / z) / z tmp = 0 if z <= -8.2e+111: tmp = t_1 elif z <= 7.5e-78: tmp = (x_m / y) / (t - z) elif z <= 2.2e+172: tmp = x_m / (z * (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 / z) / z) tmp = 0.0 if (z <= -8.2e+111) tmp = t_1; elseif (z <= 7.5e-78) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (z <= 2.2e+172) tmp = Float64(x_m / Float64(z * Float64(z - 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 <= -8.2e+111)
tmp = t_1;
elseif (z <= 7.5e-78)
tmp = (x_m / y) / (t - z);
elseif (z <= 2.2e+172)
tmp = x_m / (z * (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 / z), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -8.2e+111], t$95$1, If[LessEqual[z, 7.5e-78], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e+172], N[(x$95$m / N[(z * N[(z - t), $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 -8.2 \cdot 10^{+111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-78}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+172}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -8.19999999999999973e111 or 2.2000000000000001e172 < z Initial program 78.1%
Taylor expanded in t around 0 76.2%
mul-1-neg76.2%
associate-/r*95.6%
distribute-neg-frac295.6%
neg-sub095.6%
sub-neg95.6%
+-commutative95.6%
associate--r+95.6%
neg-sub095.6%
remove-double-neg95.6%
Simplified95.6%
Taylor expanded in z around inf 92.7%
if -8.19999999999999973e111 < z < 7.50000000000000041e-78Initial program 90.9%
Taylor expanded in y around inf 72.9%
associate-/r*75.7%
Simplified75.7%
if 7.50000000000000041e-78 < z < 2.2000000000000001e172Initial program 91.2%
Taylor expanded in y around 0 65.7%
mul-1-neg65.7%
distribute-rgt-neg-in65.7%
sub-neg65.7%
+-commutative65.7%
distribute-neg-in65.7%
remove-double-neg65.7%
unsub-neg65.7%
Simplified65.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (/ x_m z) z)))
(*
x_s
(if (<= z -1.8e+51)
t_1
(if (<= z 3.4e-74)
(/ (/ x_m t) (- y z))
(if (<= z 2.2e+172) (/ x_m (* z (- 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 / z) / z;
double tmp;
if (z <= -1.8e+51) {
tmp = t_1;
} else if (z <= 3.4e-74) {
tmp = (x_m / t) / (y - z);
} else if (z <= 2.2e+172) {
tmp = x_m / (z * (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 / z) / z
if (z <= (-1.8d+51)) then
tmp = t_1
else if (z <= 3.4d-74) then
tmp = (x_m / t) / (y - z)
else if (z <= 2.2d+172) then
tmp = x_m / (z * (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 / z) / z;
double tmp;
if (z <= -1.8e+51) {
tmp = t_1;
} else if (z <= 3.4e-74) {
tmp = (x_m / t) / (y - z);
} else if (z <= 2.2e+172) {
tmp = x_m / (z * (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 / z) / z tmp = 0 if z <= -1.8e+51: tmp = t_1 elif z <= 3.4e-74: tmp = (x_m / t) / (y - z) elif z <= 2.2e+172: tmp = x_m / (z * (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 / z) / z) tmp = 0.0 if (z <= -1.8e+51) tmp = t_1; elseif (z <= 3.4e-74) tmp = Float64(Float64(x_m / t) / Float64(y - z)); elseif (z <= 2.2e+172) tmp = Float64(x_m / Float64(z * Float64(z - 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 <= -1.8e+51)
tmp = t_1;
elseif (z <= 3.4e-74)
tmp = (x_m / t) / (y - z);
elseif (z <= 2.2e+172)
tmp = x_m / (z * (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 / z), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.8e+51], t$95$1, If[LessEqual[z, 3.4e-74], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e+172], N[(x$95$m / N[(z * N[(z - t), $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 -1.8 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-74}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+172}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -1.80000000000000005e51 or 2.2000000000000001e172 < z Initial program 79.8%
Taylor expanded in t around 0 75.5%
mul-1-neg75.5%
associate-/r*92.5%
distribute-neg-frac292.5%
neg-sub092.5%
sub-neg92.5%
+-commutative92.5%
associate--r+92.5%
neg-sub092.5%
remove-double-neg92.5%
Simplified92.5%
Taylor expanded in z around inf 87.1%
if -1.80000000000000005e51 < z < 3.4000000000000001e-74Initial program 90.8%
associate-/l/95.3%
Simplified95.3%
Taylor expanded in t around inf 71.1%
if 3.4000000000000001e-74 < z < 2.2000000000000001e172Initial program 91.2%
Taylor expanded in y around 0 65.7%
mul-1-neg65.7%
distribute-rgt-neg-in65.7%
sub-neg65.7%
+-commutative65.7%
distribute-neg-in65.7%
remove-double-neg65.7%
unsub-neg65.7%
Simplified65.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (/ x_m z) z)))
(*
x_s
(if (<= z -1.05e+35)
t_1
(if (<= z -5e-38)
(/ (/ x_m z) (- y))
(if (<= z 1.6e-55) (/ (/ 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 <= -1.05e+35) {
tmp = t_1;
} else if (z <= -5e-38) {
tmp = (x_m / z) / -y;
} else if (z <= 1.6e-55) {
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 <= (-1.05d+35)) then
tmp = t_1
else if (z <= (-5d-38)) then
tmp = (x_m / z) / -y
else if (z <= 1.6d-55) 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 <= -1.05e+35) {
tmp = t_1;
} else if (z <= -5e-38) {
tmp = (x_m / z) / -y;
} else if (z <= 1.6e-55) {
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 <= -1.05e+35: tmp = t_1 elif z <= -5e-38: tmp = (x_m / z) / -y elif z <= 1.6e-55: tmp = (x_m / t) / y else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(x_m / z) / z) tmp = 0.0 if (z <= -1.05e+35) tmp = t_1; elseif (z <= -5e-38) tmp = Float64(Float64(x_m / z) / Float64(-y)); elseif (z <= 1.6e-55) 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 <= -1.05e+35)
tmp = t_1;
elseif (z <= -5e-38)
tmp = (x_m / z) / -y;
elseif (z <= 1.6e-55)
tmp = (x_m / t) / y;
else
tmp = t_1;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.05e+35], t$95$1, If[LessEqual[z, -5e-38], N[(N[(x$95$m / z), $MachinePrecision] / (-y)), $MachinePrecision], If[LessEqual[z, 1.6e-55], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-38}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{-y}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-55}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -1.0499999999999999e35 or 1.6000000000000001e-55 < z Initial program 83.0%
Taylor expanded in t around 0 77.0%
mul-1-neg77.0%
associate-/r*89.1%
distribute-neg-frac289.1%
neg-sub089.1%
sub-neg89.1%
+-commutative89.1%
associate--r+89.1%
neg-sub089.1%
remove-double-neg89.1%
Simplified89.1%
Taylor expanded in z around inf 75.8%
if -1.0499999999999999e35 < z < -5.00000000000000033e-38Initial program 94.1%
Taylor expanded in t around 0 63.1%
mul-1-neg63.1%
associate-/r*68.9%
distribute-neg-frac268.9%
neg-sub068.9%
sub-neg68.9%
+-commutative68.9%
associate--r+68.9%
neg-sub068.9%
remove-double-neg68.9%
Simplified68.9%
Taylor expanded in z around 0 47.0%
neg-mul-147.0%
Simplified47.0%
if -5.00000000000000033e-38 < z < 1.6000000000000001e-55Initial program 91.6%
clear-num90.8%
associate-/r/91.6%
Applied egg-rr91.6%
*-commutative91.6%
associate-*r/91.6%
frac-times94.1%
clear-num93.1%
associate-*l/93.2%
*-un-lft-identity93.2%
Applied egg-rr93.2%
Taylor expanded in z around 0 63.8%
associate-/r*68.5%
Simplified68.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 z) z)))
(*
x_s
(if (<= z -1.45e+35)
t_1
(if (<= z -5.8e-40)
(/ x_m (* y (- z)))
(if (<= z 3e-53) (/ (/ 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 <= -1.45e+35) {
tmp = t_1;
} else if (z <= -5.8e-40) {
tmp = x_m / (y * -z);
} else if (z <= 3e-53) {
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 <= (-1.45d+35)) then
tmp = t_1
else if (z <= (-5.8d-40)) then
tmp = x_m / (y * -z)
else if (z <= 3d-53) 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 <= -1.45e+35) {
tmp = t_1;
} else if (z <= -5.8e-40) {
tmp = x_m / (y * -z);
} else if (z <= 3e-53) {
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 <= -1.45e+35: tmp = t_1 elif z <= -5.8e-40: tmp = x_m / (y * -z) elif z <= 3e-53: tmp = (x_m / t) / y else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(x_m / z) / z) tmp = 0.0 if (z <= -1.45e+35) tmp = t_1; elseif (z <= -5.8e-40) tmp = Float64(x_m / Float64(y * Float64(-z))); elseif (z <= 3e-53) 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 <= -1.45e+35)
tmp = t_1;
elseif (z <= -5.8e-40)
tmp = x_m / (y * -z);
elseif (z <= 3e-53)
tmp = (x_m / t) / y;
else
tmp = t_1;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.45e+35], t$95$1, If[LessEqual[z, -5.8e-40], N[(x$95$m / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e-53], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-40}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(-z\right)}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-53}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -1.44999999999999997e35 or 3.0000000000000002e-53 < z Initial program 83.0%
Taylor expanded in t around 0 77.0%
mul-1-neg77.0%
associate-/r*89.1%
distribute-neg-frac289.1%
neg-sub089.1%
sub-neg89.1%
+-commutative89.1%
associate--r+89.1%
neg-sub089.1%
remove-double-neg89.1%
Simplified89.1%
Taylor expanded in z around inf 75.8%
if -1.44999999999999997e35 < z < -5.7999999999999998e-40Initial program 94.1%
Taylor expanded in y around inf 55.0%
associate-/r*60.6%
Simplified60.6%
Taylor expanded in t around 0 41.2%
associate-*r/41.2%
neg-mul-141.2%
*-commutative41.2%
Simplified41.2%
if -5.7999999999999998e-40 < z < 3.0000000000000002e-53Initial program 91.6%
clear-num90.8%
associate-/r/91.6%
Applied egg-rr91.6%
*-commutative91.6%
associate-*r/91.6%
frac-times94.1%
clear-num93.1%
associate-*l/93.2%
*-un-lft-identity93.2%
Applied egg-rr93.2%
Taylor expanded in z around 0 63.8%
associate-/r*68.5%
Simplified68.5%
Final simplification70.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ x_m (- y z))))
(*
x_s
(if (<= z -1.24e-73)
(* t_1 (/ -1.0 z))
(if (<= z 1.25e-73) (/ t_1 t) (/ (/ 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 t_1 = x_m / (y - z);
double tmp;
if (z <= -1.24e-73) {
tmp = t_1 * (-1.0 / z);
} else if (z <= 1.25e-73) {
tmp = t_1 / t;
} 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) :: t_1
real(8) :: tmp
t_1 = x_m / (y - z)
if (z <= (-1.24d-73)) then
tmp = t_1 * ((-1.0d0) / z)
else if (z <= 1.25d-73) then
tmp = t_1 / t
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 t_1 = x_m / (y - z);
double tmp;
if (z <= -1.24e-73) {
tmp = t_1 * (-1.0 / z);
} else if (z <= 1.25e-73) {
tmp = t_1 / t;
} 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): t_1 = x_m / (y - z) tmp = 0 if z <= -1.24e-73: tmp = t_1 * (-1.0 / z) elif z <= 1.25e-73: tmp = t_1 / t 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) t_1 = Float64(x_m / Float64(y - z)) tmp = 0.0 if (z <= -1.24e-73) tmp = Float64(t_1 * Float64(-1.0 / z)); elseif (z <= 1.25e-73) tmp = Float64(t_1 / t); 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)
t_1 = x_m / (y - z);
tmp = 0.0;
if (z <= -1.24e-73)
tmp = t_1 * (-1.0 / z);
elseif (z <= 1.25e-73)
tmp = t_1 / t;
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_] := Block[{t$95$1 = N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.24e-73], N[(t$95$1 * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e-73], N[(t$95$1 / t), $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])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{y - z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.24 \cdot 10^{-73}:\\
\;\;\;\;t\_1 \cdot \frac{-1}{z}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-73}:\\
\;\;\;\;\frac{t\_1}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{z - t}}{z}\\
\end{array}
\end{array}
\end{array}
if z < -1.2400000000000001e-73Initial program 85.0%
associate-/r*98.7%
div-inv98.6%
Applied egg-rr98.6%
Taylor expanded in t around 0 80.3%
if -1.2400000000000001e-73 < z < 1.25e-73Initial program 90.4%
Taylor expanded in x around 0 90.4%
associate-/l/94.2%
Simplified94.2%
Taylor expanded in t around inf 79.5%
if 1.25e-73 < z Initial program 85.6%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around 0 79.6%
neg-mul-179.6%
Simplified79.6%
Final simplification79.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 (<= z -1.42e-73)
(/ (/ x_m (- z y)) z)
(if (<= z 3.1e-77) (/ (/ x_m (- y z)) t) (/ (/ 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.42e-73) {
tmp = (x_m / (z - y)) / z;
} else if (z <= 3.1e-77) {
tmp = (x_m / (y - z)) / t;
} 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.42d-73)) then
tmp = (x_m / (z - y)) / z
else if (z <= 3.1d-77) then
tmp = (x_m / (y - z)) / t
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.42e-73) {
tmp = (x_m / (z - y)) / z;
} else if (z <= 3.1e-77) {
tmp = (x_m / (y - z)) / t;
} 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.42e-73: tmp = (x_m / (z - y)) / z elif z <= 3.1e-77: tmp = (x_m / (y - z)) / t 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.42e-73) tmp = Float64(Float64(x_m / Float64(z - y)) / z); elseif (z <= 3.1e-77) tmp = Float64(Float64(x_m / Float64(y - z)) / t); 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.42e-73)
tmp = (x_m / (z - y)) / z;
elseif (z <= 3.1e-77)
tmp = (x_m / (y - z)) / t;
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.42e-73], N[(N[(x$95$m / N[(z - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 3.1e-77], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $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.42 \cdot 10^{-73}:\\
\;\;\;\;\frac{\frac{x\_m}{z - y}}{z}\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-77}:\\
\;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{z - t}}{z}\\
\end{array}
\end{array}
if z < -1.42e-73Initial program 85.0%
Taylor expanded in t around 0 70.4%
mul-1-neg70.4%
associate-/r*80.2%
distribute-neg-frac280.2%
neg-sub080.2%
sub-neg80.2%
+-commutative80.2%
associate--r+80.2%
neg-sub080.2%
remove-double-neg80.2%
Simplified80.2%
Taylor expanded in x around 0 70.4%
*-commutative70.4%
associate-/r*80.3%
Simplified80.3%
if -1.42e-73 < z < 3.10000000000000008e-77Initial program 90.4%
Taylor expanded in x around 0 90.4%
associate-/l/94.2%
Simplified94.2%
Taylor expanded in t around inf 79.5%
if 3.10000000000000008e-77 < z Initial program 85.6%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around 0 79.6%
neg-mul-179.6%
Simplified79.6%
Final simplification79.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 (<= z -7e-74)
(/ (/ x_m (- z y)) z)
(if (<= z 7.5e-76) (/ (/ x_m (- y z)) t) (/ (/ x_m z) (- z t))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -7e-74) {
tmp = (x_m / (z - y)) / z;
} else if (z <= 7.5e-76) {
tmp = (x_m / (y - z)) / t;
} else {
tmp = (x_m / z) / (z - t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-7d-74)) then
tmp = (x_m / (z - y)) / z
else if (z <= 7.5d-76) then
tmp = (x_m / (y - z)) / t
else
tmp = (x_m / z) / (z - t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -7e-74) {
tmp = (x_m / (z - y)) / z;
} else if (z <= 7.5e-76) {
tmp = (x_m / (y - z)) / t;
} else {
tmp = (x_m / z) / (z - t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if z <= -7e-74: tmp = (x_m / (z - y)) / z elif z <= 7.5e-76: tmp = (x_m / (y - z)) / t else: tmp = (x_m / z) / (z - t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -7e-74) tmp = Float64(Float64(x_m / Float64(z - y)) / z); elseif (z <= 7.5e-76) tmp = Float64(Float64(x_m / Float64(y - z)) / t); else tmp = Float64(Float64(x_m / z) / Float64(z - t)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (z <= -7e-74)
tmp = (x_m / (z - y)) / z;
elseif (z <= 7.5e-76)
tmp = (x_m / (y - z)) / t;
else
tmp = (x_m / z) / (z - t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -7e-74], N[(N[(x$95$m / N[(z - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 7.5e-76], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-74}:\\
\;\;\;\;\frac{\frac{x\_m}{z - y}}{z}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-76}:\\
\;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\end{array}
\end{array}
if z < -7.00000000000000029e-74Initial program 85.0%
Taylor expanded in t around 0 70.4%
mul-1-neg70.4%
associate-/r*80.2%
distribute-neg-frac280.2%
neg-sub080.2%
sub-neg80.2%
+-commutative80.2%
associate--r+80.2%
neg-sub080.2%
remove-double-neg80.2%
Simplified80.2%
Taylor expanded in x around 0 70.4%
*-commutative70.4%
associate-/r*80.3%
Simplified80.3%
if -7.00000000000000029e-74 < z < 7.4999999999999997e-76Initial program 90.4%
Taylor expanded in x around 0 90.4%
associate-/l/94.2%
Simplified94.2%
Taylor expanded in t around inf 79.5%
if 7.4999999999999997e-76 < z Initial program 85.6%
Taylor expanded in y around 0 70.8%
mul-1-neg70.8%
associate-/r*79.6%
distribute-neg-frac279.6%
sub-neg79.6%
+-commutative79.6%
distribute-neg-in79.6%
remove-double-neg79.6%
unsub-neg79.6%
Simplified79.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 -6.2e-38)
(/ (/ x_m z) (- z y))
(if (<= z 1.2e-73) (/ (/ x_m (- y z)) t) (/ (/ x_m z) (- z t))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -6.2e-38) {
tmp = (x_m / z) / (z - y);
} else if (z <= 1.2e-73) {
tmp = (x_m / (y - z)) / t;
} else {
tmp = (x_m / z) / (z - t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-6.2d-38)) then
tmp = (x_m / z) / (z - y)
else if (z <= 1.2d-73) then
tmp = (x_m / (y - z)) / t
else
tmp = (x_m / z) / (z - t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -6.2e-38) {
tmp = (x_m / z) / (z - y);
} else if (z <= 1.2e-73) {
tmp = (x_m / (y - z)) / t;
} else {
tmp = (x_m / z) / (z - t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if z <= -6.2e-38: tmp = (x_m / z) / (z - y) elif z <= 1.2e-73: tmp = (x_m / (y - z)) / t else: tmp = (x_m / z) / (z - t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -6.2e-38) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (z <= 1.2e-73) tmp = Float64(Float64(x_m / Float64(y - z)) / t); else tmp = Float64(Float64(x_m / z) / Float64(z - t)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (z <= -6.2e-38)
tmp = (x_m / z) / (z - y);
elseif (z <= 1.2e-73)
tmp = (x_m / (y - z)) / t;
else
tmp = (x_m / z) / (z - t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -6.2e-38], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e-73], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-38}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-73}:\\
\;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\end{array}
\end{array}
if z < -6.19999999999999966e-38Initial program 83.5%
Taylor expanded in t around 0 70.3%
mul-1-neg70.3%
associate-/r*82.5%
distribute-neg-frac282.5%
neg-sub082.5%
sub-neg82.5%
+-commutative82.5%
associate--r+82.5%
neg-sub082.5%
remove-double-neg82.5%
Simplified82.5%
if -6.19999999999999966e-38 < z < 1.20000000000000003e-73Initial program 91.1%
Taylor expanded in x around 0 91.1%
associate-/l/93.7%
Simplified93.7%
Taylor expanded in t around inf 76.9%
if 1.20000000000000003e-73 < z Initial program 85.6%
Taylor expanded in y around 0 70.8%
mul-1-neg70.8%
associate-/r*79.6%
distribute-neg-frac279.6%
sub-neg79.6%
+-commutative79.6%
distribute-neg-in79.6%
remove-double-neg79.6%
unsub-neg79.6%
Simplified79.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.95e-38)
(/ (/ x_m z) (- z y))
(if (<= z 5.2e-76) (/ (/ x_m t) (- y z)) (/ (/ x_m z) (- z t))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -1.95e-38) {
tmp = (x_m / z) / (z - y);
} else if (z <= 5.2e-76) {
tmp = (x_m / t) / (y - z);
} else {
tmp = (x_m / z) / (z - t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.95d-38)) then
tmp = (x_m / z) / (z - y)
else if (z <= 5.2d-76) then
tmp = (x_m / t) / (y - z)
else
tmp = (x_m / z) / (z - t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -1.95e-38) {
tmp = (x_m / z) / (z - y);
} else if (z <= 5.2e-76) {
tmp = (x_m / t) / (y - z);
} else {
tmp = (x_m / z) / (z - t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if z <= -1.95e-38: tmp = (x_m / z) / (z - y) elif z <= 5.2e-76: tmp = (x_m / t) / (y - z) else: tmp = (x_m / z) / (z - t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -1.95e-38) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (z <= 5.2e-76) tmp = Float64(Float64(x_m / t) / Float64(y - z)); else tmp = Float64(Float64(x_m / z) / Float64(z - t)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (z <= -1.95e-38)
tmp = (x_m / z) / (z - y);
elseif (z <= 5.2e-76)
tmp = (x_m / t) / (y - z);
else
tmp = (x_m / z) / (z - t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -1.95e-38], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e-76], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{-38}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-76}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\end{array}
\end{array}
if z < -1.95e-38Initial program 83.5%
Taylor expanded in t around 0 70.3%
mul-1-neg70.3%
associate-/r*82.5%
distribute-neg-frac282.5%
neg-sub082.5%
sub-neg82.5%
+-commutative82.5%
associate--r+82.5%
neg-sub082.5%
remove-double-neg82.5%
Simplified82.5%
if -1.95e-38 < z < 5.1999999999999999e-76Initial program 91.1%
associate-/l/94.4%
Simplified94.4%
Taylor expanded in t around inf 76.8%
if 5.1999999999999999e-76 < z Initial program 85.6%
Taylor expanded in y around 0 70.8%
mul-1-neg70.8%
associate-/r*79.6%
distribute-neg-frac279.6%
sub-neg79.6%
+-commutative79.6%
distribute-neg-in79.6%
remove-double-neg79.6%
unsub-neg79.6%
Simplified79.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 (<= y -5800000000000.0)
(/ (/ x_m y) (- t z))
(if (<= y 6e-194) (/ (/ 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 <= -5800000000000.0) {
tmp = (x_m / y) / (t - z);
} else if (y <= 6e-194) {
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 <= (-5800000000000.0d0)) then
tmp = (x_m / y) / (t - z)
else if (y <= 6d-194) 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 <= -5800000000000.0) {
tmp = (x_m / y) / (t - z);
} else if (y <= 6e-194) {
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 <= -5800000000000.0: tmp = (x_m / y) / (t - z) elif y <= 6e-194: 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 <= -5800000000000.0) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= 6e-194) tmp = Float64(Float64(x_m / z) / Float64(z - t)); else tmp = Float64(x_m / Float64(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 <= -5800000000000.0)
tmp = (x_m / y) / (t - z);
elseif (y <= 6e-194)
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, -5800000000000.0], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e-194], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5800000000000:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-194}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -5.8e12Initial program 84.2%
Taylor expanded in y around inf 79.1%
associate-/r*87.3%
Simplified87.3%
if -5.8e12 < y < 6e-194Initial program 88.3%
Taylor expanded in y around 0 74.9%
mul-1-neg74.9%
associate-/r*85.5%
distribute-neg-frac285.5%
sub-neg85.5%
+-commutative85.5%
distribute-neg-in85.5%
remove-double-neg85.5%
unsub-neg85.5%
Simplified85.5%
if 6e-194 < y Initial program 87.6%
Taylor expanded in t around inf 52.6%
Final simplification73.0%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -3e-74)
(/ (/ x_m t) y)
(if (<= t 5e-47) (/ (/ x_m z) 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 <= -3e-74) {
tmp = (x_m / t) / y;
} else if (t <= 5e-47) {
tmp = (x_m / z) / 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 <= (-3d-74)) then
tmp = (x_m / t) / y
else if (t <= 5d-47) then
tmp = (x_m / z) / 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 <= -3e-74) {
tmp = (x_m / t) / y;
} else if (t <= 5e-47) {
tmp = (x_m / z) / 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 <= -3e-74: tmp = (x_m / t) / y elif t <= 5e-47: tmp = (x_m / z) / 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 <= -3e-74) tmp = Float64(Float64(x_m / t) / y); elseif (t <= 5e-47) tmp = Float64(Float64(x_m / z) / z); else tmp = Float64(x_m / Float64(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 <= -3e-74)
tmp = (x_m / t) / y;
elseif (t <= 5e-47)
tmp = (x_m / z) / 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, -3e-74], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 5e-47], N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision], N[(x$95$m / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{-74}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-47}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if t < -3.00000000000000007e-74Initial program 84.1%
clear-num83.9%
associate-/r/84.0%
Applied egg-rr84.0%
*-commutative84.0%
associate-*r/84.1%
frac-times97.3%
clear-num96.5%
associate-*l/96.7%
*-un-lft-identity96.7%
Applied egg-rr96.7%
Taylor expanded in z around 0 46.9%
associate-/r*49.7%
Simplified49.7%
if -3.00000000000000007e-74 < t < 5.00000000000000011e-47Initial program 88.7%
Taylor expanded in t around 0 76.6%
mul-1-neg76.6%
associate-/r*85.1%
distribute-neg-frac285.1%
neg-sub085.1%
sub-neg85.1%
+-commutative85.1%
associate--r+85.1%
neg-sub085.1%
remove-double-neg85.1%
Simplified85.1%
Taylor expanded in z around inf 63.6%
if 5.00000000000000011e-47 < t Initial program 86.9%
Taylor expanded in t around inf 77.4%
Final simplification64.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -9.2e-28) (not (<= z 1.06e-53)))
(/ (/ x_m z) z)
(/ (/ x_m t) y))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -9.2e-28) || !(z <= 1.06e-53)) {
tmp = (x_m / z) / z;
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-9.2d-28)) .or. (.not. (z <= 1.06d-53))) then
tmp = (x_m / z) / z
else
tmp = (x_m / t) / y
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -9.2e-28) || !(z <= 1.06e-53)) {
tmp = (x_m / z) / z;
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -9.2e-28) or not (z <= 1.06e-53): tmp = (x_m / z) / z else: tmp = (x_m / t) / y return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -9.2e-28) || !(z <= 1.06e-53)) tmp = Float64(Float64(x_m / z) / z); else tmp = Float64(Float64(x_m / t) / y); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -9.2e-28) || ~((z <= 1.06e-53)))
tmp = (x_m / z) / z;
else
tmp = (x_m / t) / y;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -9.2e-28], N[Not[LessEqual[z, 1.06e-53]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{-28} \lor \neg \left(z \leq 1.06 \cdot 10^{-53}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if z < -9.19999999999999942e-28 or 1.06000000000000011e-53 < z Initial program 83.9%
Taylor expanded in t around 0 75.7%
mul-1-neg75.7%
associate-/r*87.3%
distribute-neg-frac287.3%
neg-sub087.3%
sub-neg87.3%
+-commutative87.3%
associate--r+87.3%
neg-sub087.3%
remove-double-neg87.3%
Simplified87.3%
Taylor expanded in z around inf 71.2%
if -9.19999999999999942e-28 < z < 1.06000000000000011e-53Initial program 91.9%
clear-num91.0%
associate-/r/91.9%
Applied egg-rr91.9%
*-commutative91.9%
associate-*r/91.9%
frac-times94.2%
clear-num93.3%
associate-*l/93.4%
*-un-lft-identity93.4%
Applied egg-rr93.4%
Taylor expanded in z around 0 62.9%
associate-/r*67.5%
Simplified67.5%
Final simplification69.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -9e+111) (not (<= z 1.2e+52)))
(/ x_m (* t 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 <= -9e+111) || !(z <= 1.2e+52)) {
tmp = x_m / (t * 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 <= (-9d+111)) .or. (.not. (z <= 1.2d+52))) then
tmp = x_m / (t * 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 <= -9e+111) || !(z <= 1.2e+52)) {
tmp = x_m / (t * 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 <= -9e+111) or not (z <= 1.2e+52): tmp = x_m / (t * 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 <= -9e+111) || !(z <= 1.2e+52)) tmp = Float64(x_m / Float64(t * 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 <= -9e+111) || ~((z <= 1.2e+52)))
tmp = x_m / (t * 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, -9e+111], N[Not[LessEqual[z, 1.2e+52]], $MachinePrecision]], N[(x$95$m / N[(t * 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 -9 \cdot 10^{+111} \lor \neg \left(z \leq 1.2 \cdot 10^{+52}\right):\\
\;\;\;\;\frac{x\_m}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\end{array}
\end{array}
if z < -9.00000000000000001e111 or 1.2e52 < z Initial program 79.6%
Taylor expanded in x around 0 79.6%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 42.3%
Taylor expanded in y around 0 40.5%
associate-*r/40.5%
neg-mul-140.5%
Simplified40.5%
associate-/l/36.5%
div-inv36.6%
add-sqr-sqrt16.1%
sqrt-unprod35.2%
sqr-neg35.2%
sqrt-unprod19.4%
add-sqr-sqrt34.8%
Applied egg-rr34.8%
associate-*r/34.8%
*-rgt-identity34.8%
*-commutative34.8%
Simplified34.8%
if -9.00000000000000001e111 < z < 1.2e52Initial program 92.5%
Taylor expanded in y around inf 68.3%
associate-/r*70.6%
Simplified70.6%
Taylor expanded in t around inf 54.5%
Final simplification46.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
(*
x_s
(if (or (<= z -1.4e+113) (not (<= z 1.35e+52)))
(/ x_m (* t z))
(/ (/ x_m t) y))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1.4e+113) || !(z <= 1.35e+52)) {
tmp = x_m / (t * z);
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.4d+113)) .or. (.not. (z <= 1.35d+52))) then
tmp = x_m / (t * z)
else
tmp = (x_m / t) / y
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1.4e+113) || !(z <= 1.35e+52)) {
tmp = x_m / (t * z);
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -1.4e+113) or not (z <= 1.35e+52): tmp = x_m / (t * z) else: tmp = (x_m / t) / y return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -1.4e+113) || !(z <= 1.35e+52)) tmp = Float64(x_m / Float64(t * z)); else tmp = Float64(Float64(x_m / t) / y); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -1.4e+113) || ~((z <= 1.35e+52)))
tmp = x_m / (t * z);
else
tmp = (x_m / t) / y;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -1.4e+113], N[Not[LessEqual[z, 1.35e+52]], $MachinePrecision]], N[(x$95$m / N[(t * z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+113} \lor \neg \left(z \leq 1.35 \cdot 10^{+52}\right):\\
\;\;\;\;\frac{x\_m}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if z < -1.39999999999999999e113 or 1.35e52 < z Initial program 79.6%
Taylor expanded in x around 0 79.6%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 42.3%
Taylor expanded in y around 0 40.5%
associate-*r/40.5%
neg-mul-140.5%
Simplified40.5%
associate-/l/36.5%
div-inv36.6%
add-sqr-sqrt16.1%
sqrt-unprod35.2%
sqr-neg35.2%
sqrt-unprod19.4%
add-sqr-sqrt34.8%
Applied egg-rr34.8%
associate-*r/34.8%
*-rgt-identity34.8%
*-commutative34.8%
Simplified34.8%
if -1.39999999999999999e113 < z < 1.35e52Initial program 92.5%
clear-num91.8%
associate-/r/92.4%
Applied egg-rr92.4%
*-commutative92.4%
associate-*r/92.5%
frac-times96.0%
clear-num95.2%
associate-*l/95.3%
*-un-lft-identity95.3%
Applied egg-rr95.3%
Taylor expanded in z around 0 50.0%
associate-/r*53.7%
Simplified53.7%
Final simplification45.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 -3.3e+112) (not (<= z 1.05e+51)))
(/ x_m (* t z))
(/ x_m (* t y)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -3.3e+112) || !(z <= 1.05e+51)) {
tmp = x_m / (t * z);
} else {
tmp = x_m / (t * y);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3.3d+112)) .or. (.not. (z <= 1.05d+51))) then
tmp = x_m / (t * z)
else
tmp = x_m / (t * y)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -3.3e+112) || !(z <= 1.05e+51)) {
tmp = x_m / (t * z);
} else {
tmp = x_m / (t * y);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -3.3e+112) or not (z <= 1.05e+51): tmp = x_m / (t * z) else: tmp = x_m / (t * y) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -3.3e+112) || !(z <= 1.05e+51)) tmp = Float64(x_m / Float64(t * z)); else tmp = Float64(x_m / Float64(t * y)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -3.3e+112) || ~((z <= 1.05e+51)))
tmp = x_m / (t * z);
else
tmp = x_m / (t * y);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -3.3e+112], N[Not[LessEqual[z, 1.05e+51]], $MachinePrecision]], N[(x$95$m / N[(t * z), $MachinePrecision]), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+112} \lor \neg \left(z \leq 1.05 \cdot 10^{+51}\right):\\
\;\;\;\;\frac{x\_m}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{t \cdot y}\\
\end{array}
\end{array}
if z < -3.2999999999999999e112 or 1.0500000000000001e51 < z Initial program 79.6%
Taylor expanded in x around 0 79.6%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 42.3%
Taylor expanded in y around 0 40.5%
associate-*r/40.5%
neg-mul-140.5%
Simplified40.5%
associate-/l/36.5%
div-inv36.6%
add-sqr-sqrt16.1%
sqrt-unprod35.2%
sqr-neg35.2%
sqrt-unprod19.4%
add-sqr-sqrt34.8%
Applied egg-rr34.8%
associate-*r/34.8%
*-rgt-identity34.8%
*-commutative34.8%
Simplified34.8%
if -3.2999999999999999e112 < z < 1.0500000000000001e51Initial program 92.5%
Taylor expanded in z around 0 50.0%
Final simplification43.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 -2.7e+113)
(/ (/ x_m z) t)
(if (<= z 3.9e+52) (/ (/ x_m y) t) (/ 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 (z <= -2.7e+113) {
tmp = (x_m / z) / t;
} else if (z <= 3.9e+52) {
tmp = (x_m / y) / t;
} 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 (z <= (-2.7d+113)) then
tmp = (x_m / z) / t
else if (z <= 3.9d+52) then
tmp = (x_m / y) / t
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 (z <= -2.7e+113) {
tmp = (x_m / z) / t;
} else if (z <= 3.9e+52) {
tmp = (x_m / y) / t;
} 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 z <= -2.7e+113: tmp = (x_m / z) / t elif z <= 3.9e+52: tmp = (x_m / y) / t 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 (z <= -2.7e+113) tmp = Float64(Float64(x_m / z) / t); elseif (z <= 3.9e+52) tmp = Float64(Float64(x_m / y) / t); else tmp = 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 (z <= -2.7e+113)
tmp = (x_m / z) / t;
elseif (z <= 3.9e+52)
tmp = (x_m / y) / t;
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[z, -2.7e+113], N[(N[(x$95$m / z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3.9e+52], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], N[(x$95$m / N[(t * z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+113}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{t}\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+52}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{t \cdot z}\\
\end{array}
\end{array}
if z < -2.70000000000000011e113Initial program 78.3%
Taylor expanded in x around 0 78.3%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around inf 52.3%
Taylor expanded in y around 0 49.9%
associate-*r/49.9%
neg-mul-149.9%
Simplified49.9%
add-sqr-sqrt21.9%
sqrt-unprod47.6%
sqr-neg47.6%
sqrt-unprod25.4%
add-sqr-sqrt44.8%
div-inv44.8%
Applied egg-rr44.8%
associate-*r/44.8%
*-rgt-identity44.8%
Simplified44.8%
if -2.70000000000000011e113 < z < 3.9e52Initial program 92.5%
Taylor expanded in y around inf 68.3%
associate-/r*70.6%
Simplified70.6%
Taylor expanded in t around inf 54.5%
if 3.9e52 < z Initial program 80.3%
Taylor expanded in x around 0 80.3%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 36.6%
Taylor expanded in y around 0 35.2%
associate-*r/35.2%
neg-mul-135.2%
Simplified35.2%
associate-/l/28.4%
div-inv28.5%
add-sqr-sqrt14.4%
sqrt-unprod29.9%
sqr-neg29.9%
sqrt-unprod12.7%
add-sqr-sqrt27.2%
Applied egg-rr27.2%
associate-*r/27.2%
*-rgt-identity27.2%
*-commutative27.2%
Simplified27.2%
Final simplification45.7%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x_s x_m y z t) :precision binary64 (* x_s (/ (/ -1.0 (- z t)) (/ (- y z) x_m))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * ((-1.0 / (z - t)) / ((y - z) / x_m));
}
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 * (((-1.0d0) / (z - t)) / ((y - z) / x_m))
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 * ((-1.0 / (z - t)) / ((y - z) / x_m));
}
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 * ((-1.0 / (z - t)) / ((y - z) / x_m))
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(Float64(-1.0 / Float64(z - t)) / Float64(Float64(y - z) / x_m))) 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 * ((-1.0 / (z - t)) / ((y - z) / x_m));
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[(N[(-1.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(N[(y - z), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \frac{\frac{-1}{z - t}}{\frac{y - z}{x\_m}}
\end{array}
Initial program 87.0%
clear-num86.6%
associate-/r/87.0%
Applied egg-rr87.0%
*-commutative87.0%
associate-*r/87.0%
frac-times97.5%
clear-num97.1%
associate-*l/97.2%
*-un-lft-identity97.2%
Applied egg-rr97.2%
Final simplification97.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 (* x_s (/ (/ x_m (- z 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) {
return x_s * ((x_m / (z - y)) / (z - 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 / (z - y)) / (z - 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 / (z - y)) / (z - 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 / (z - y)) / (z - 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(Float64(x_m / Float64(z - y)) / Float64(z - 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 / (z - y)) / (z - 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[(N[(x$95$m / N[(z - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \frac{\frac{x\_m}{z - y}}{z - t}
\end{array}
Initial program 87.0%
Taylor expanded in x around 0 87.0%
associate-/l/97.6%
Simplified97.6%
Final simplification97.6%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x_s x_m y z t) :precision binary64 (* x_s (/ x_m (* 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 87.0%
Taylor expanded in z around 0 35.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 2024170
(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))))