
(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 12 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 -2e-307) 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 / ((y - z) * (t - z));
double tmp;
if (t_1 <= -2e-307) {
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 / ((y - z) * (t - z))
if (t_1 <= (-2d-307)) 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 / ((y - z) * (t - z));
double tmp;
if (t_1 <= -2e-307) {
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 / ((y - z) * (t - z)) tmp = 0 if t_1 <= -2e-307: 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(y - z) * Float64(t - z))) tmp = 0.0 if (t_1 <= -2e-307) 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 / ((y - z) * (t - z));
tmp = 0.0;
if (t_1 <= -2e-307)
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[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, -2e-307], 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(y - z\right) \cdot \left(t - z\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-307}:\\
\;\;\;\;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.99999999999999982e-307Initial program 98.1%
if -1.99999999999999982e-307 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 85.6%
associate-/l/97.8%
Simplified97.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 -1.65e+64)
t_1
(if (<= z -2.1e-190)
(/ (/ x_m t) (- y z))
(if (<= z 6e-78)
(/ x_m (* y (- t z)))
(if (<= z 3.25e+158) (/ 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.65e+64) {
tmp = t_1;
} else if (z <= -2.1e-190) {
tmp = (x_m / t) / (y - z);
} else if (z <= 6e-78) {
tmp = x_m / (y * (t - z));
} else if (z <= 3.25e+158) {
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.65d+64)) then
tmp = t_1
else if (z <= (-2.1d-190)) then
tmp = (x_m / t) / (y - z)
else if (z <= 6d-78) then
tmp = x_m / (y * (t - z))
else if (z <= 3.25d+158) 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.65e+64) {
tmp = t_1;
} else if (z <= -2.1e-190) {
tmp = (x_m / t) / (y - z);
} else if (z <= 6e-78) {
tmp = x_m / (y * (t - z));
} else if (z <= 3.25e+158) {
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.65e+64: tmp = t_1 elif z <= -2.1e-190: tmp = (x_m / t) / (y - z) elif z <= 6e-78: tmp = x_m / (y * (t - z)) elif z <= 3.25e+158: 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.65e+64) tmp = t_1; elseif (z <= -2.1e-190) tmp = Float64(Float64(x_m / t) / Float64(y - z)); elseif (z <= 6e-78) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (z <= 3.25e+158) 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.65e+64)
tmp = t_1;
elseif (z <= -2.1e-190)
tmp = (x_m / t) / (y - z);
elseif (z <= 6e-78)
tmp = x_m / (y * (t - z));
elseif (z <= 3.25e+158)
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.65e+64], t$95$1, If[LessEqual[z, -2.1e-190], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e-78], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.25e+158], 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.65 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-190}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-78}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;z \leq 3.25 \cdot 10^{+158}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -1.64999999999999994e64 or 3.2500000000000001e158 < z Initial program 78.7%
Taylor expanded in t around 0 75.1%
mul-1-neg75.1%
associate-/r*93.3%
distribute-neg-frac293.3%
neg-sub093.3%
sub-neg93.3%
+-commutative93.3%
associate--r+93.3%
neg-sub093.3%
remove-double-neg93.3%
Simplified93.3%
Taylor expanded in z around inf 89.1%
if -1.64999999999999994e64 < z < -2.09999999999999991e-190Initial program 93.8%
associate-/l/97.9%
Simplified97.9%
Taylor expanded in t around inf 70.9%
if -2.09999999999999991e-190 < z < 5.99999999999999975e-78Initial program 97.2%
Taylor expanded in y around inf 88.2%
*-commutative88.2%
Simplified88.2%
if 5.99999999999999975e-78 < z < 3.2500000000000001e158Initial program 90.1%
Taylor expanded in y around 0 65.6%
mul-1-neg65.6%
distribute-rgt-neg-in65.6%
sub-neg65.6%
+-commutative65.6%
distribute-neg-in65.6%
remove-double-neg65.6%
unsub-neg65.6%
Simplified65.6%
Final simplification81.0%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ x_m (* z (- z t)))) (t_2 (/ (/ x_m z) z)))
(*
x_s
(if (<= z -2.25e+164)
t_2
(if (<= z -1e-19)
t_1
(if (<= z 1.85e-75)
(/ x_m (* y (- t z)))
(if (<= z 3.25e+158) t_1 t_2)))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (z * (z - t));
double t_2 = (x_m / z) / z;
double tmp;
if (z <= -2.25e+164) {
tmp = t_2;
} else if (z <= -1e-19) {
tmp = t_1;
} else if (z <= 1.85e-75) {
tmp = x_m / (y * (t - z));
} else if (z <= 3.25e+158) {
tmp = t_1;
} else {
tmp = t_2;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x_m / (z * (z - t))
t_2 = (x_m / z) / z
if (z <= (-2.25d+164)) then
tmp = t_2
else if (z <= (-1d-19)) then
tmp = t_1
else if (z <= 1.85d-75) then
tmp = x_m / (y * (t - z))
else if (z <= 3.25d+158) then
tmp = t_1
else
tmp = t_2
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (z * (z - t));
double t_2 = (x_m / z) / z;
double tmp;
if (z <= -2.25e+164) {
tmp = t_2;
} else if (z <= -1e-19) {
tmp = t_1;
} else if (z <= 1.85e-75) {
tmp = x_m / (y * (t - z));
} else if (z <= 3.25e+158) {
tmp = t_1;
} else {
tmp = t_2;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = x_m / (z * (z - t)) t_2 = (x_m / z) / z tmp = 0 if z <= -2.25e+164: tmp = t_2 elif z <= -1e-19: tmp = t_1 elif z <= 1.85e-75: tmp = x_m / (y * (t - z)) elif z <= 3.25e+158: tmp = t_1 else: tmp = t_2 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m / Float64(z * Float64(z - t))) t_2 = Float64(Float64(x_m / z) / z) tmp = 0.0 if (z <= -2.25e+164) tmp = t_2; elseif (z <= -1e-19) tmp = t_1; elseif (z <= 1.85e-75) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (z <= 3.25e+158) tmp = t_1; else tmp = t_2; end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = x_m / (z * (z - t));
t_2 = (x_m / z) / z;
tmp = 0.0;
if (z <= -2.25e+164)
tmp = t_2;
elseif (z <= -1e-19)
tmp = t_1;
elseif (z <= 1.85e-75)
tmp = x_m / (y * (t - z));
elseif (z <= 3.25e+158)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -2.25e+164], t$95$2, If[LessEqual[z, -1e-19], t$95$1, If[LessEqual[z, 1.85e-75], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.25e+158], t$95$1, t$95$2]]]]), $MachinePrecision]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z \cdot \left(z - t\right)}\\
t_2 := \frac{\frac{x\_m}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+164}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-75}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;z \leq 3.25 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if z < -2.24999999999999988e164 or 3.2500000000000001e158 < z Initial program 74.1%
Taylor expanded in t around 0 74.1%
mul-1-neg74.1%
associate-/r*98.1%
distribute-neg-frac298.1%
neg-sub098.1%
sub-neg98.1%
+-commutative98.1%
associate--r+98.1%
neg-sub098.1%
remove-double-neg98.1%
Simplified98.1%
Taylor expanded in z around inf 98.1%
if -2.24999999999999988e164 < z < -9.9999999999999998e-20 or 1.85000000000000012e-75 < z < 3.2500000000000001e158Initial program 89.2%
Taylor expanded in y around 0 68.1%
mul-1-neg68.1%
distribute-rgt-neg-in68.1%
sub-neg68.1%
+-commutative68.1%
distribute-neg-in68.1%
remove-double-neg68.1%
unsub-neg68.1%
Simplified68.1%
if -9.9999999999999998e-20 < z < 1.85000000000000012e-75Initial program 97.1%
Taylor expanded in y around inf 84.0%
*-commutative84.0%
Simplified84.0%
Final simplification81.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ x_m (* z (- z t)))) (t_2 (/ (/ x_m z) z)))
(*
x_s
(if (<= z -2.25e+164)
t_2
(if (<= z -1.45e-63)
t_1
(if (<= z 2.8e-76) (/ x_m (* y t)) (if (<= z 3.3e+158) t_1 t_2)))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (z * (z - t));
double t_2 = (x_m / z) / z;
double tmp;
if (z <= -2.25e+164) {
tmp = t_2;
} else if (z <= -1.45e-63) {
tmp = t_1;
} else if (z <= 2.8e-76) {
tmp = x_m / (y * t);
} else if (z <= 3.3e+158) {
tmp = t_1;
} else {
tmp = t_2;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x_m / (z * (z - t))
t_2 = (x_m / z) / z
if (z <= (-2.25d+164)) then
tmp = t_2
else if (z <= (-1.45d-63)) then
tmp = t_1
else if (z <= 2.8d-76) then
tmp = x_m / (y * t)
else if (z <= 3.3d+158) then
tmp = t_1
else
tmp = t_2
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (z * (z - t));
double t_2 = (x_m / z) / z;
double tmp;
if (z <= -2.25e+164) {
tmp = t_2;
} else if (z <= -1.45e-63) {
tmp = t_1;
} else if (z <= 2.8e-76) {
tmp = x_m / (y * t);
} else if (z <= 3.3e+158) {
tmp = t_1;
} else {
tmp = t_2;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = x_m / (z * (z - t)) t_2 = (x_m / z) / z tmp = 0 if z <= -2.25e+164: tmp = t_2 elif z <= -1.45e-63: tmp = t_1 elif z <= 2.8e-76: tmp = x_m / (y * t) elif z <= 3.3e+158: tmp = t_1 else: tmp = t_2 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m / Float64(z * Float64(z - t))) t_2 = Float64(Float64(x_m / z) / z) tmp = 0.0 if (z <= -2.25e+164) tmp = t_2; elseif (z <= -1.45e-63) tmp = t_1; elseif (z <= 2.8e-76) tmp = Float64(x_m / Float64(y * t)); elseif (z <= 3.3e+158) tmp = t_1; else tmp = t_2; end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = x_m / (z * (z - t));
t_2 = (x_m / z) / z;
tmp = 0.0;
if (z <= -2.25e+164)
tmp = t_2;
elseif (z <= -1.45e-63)
tmp = t_1;
elseif (z <= 2.8e-76)
tmp = x_m / (y * t);
elseif (z <= 3.3e+158)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -2.25e+164], t$95$2, If[LessEqual[z, -1.45e-63], t$95$1, If[LessEqual[z, 2.8e-76], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e+158], t$95$1, t$95$2]]]]), $MachinePrecision]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z \cdot \left(z - t\right)}\\
t_2 := \frac{\frac{x\_m}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+164}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-76}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if z < -2.24999999999999988e164 or 3.30000000000000017e158 < z Initial program 74.1%
Taylor expanded in t around 0 74.1%
mul-1-neg74.1%
associate-/r*98.1%
distribute-neg-frac298.1%
neg-sub098.1%
sub-neg98.1%
+-commutative98.1%
associate--r+98.1%
neg-sub098.1%
remove-double-neg98.1%
Simplified98.1%
Taylor expanded in z around inf 98.1%
if -2.24999999999999988e164 < z < -1.44999999999999987e-63 or 2.8000000000000001e-76 < z < 3.30000000000000017e158Initial program 90.3%
Taylor expanded in y around 0 68.3%
mul-1-neg68.3%
distribute-rgt-neg-in68.3%
sub-neg68.3%
+-commutative68.3%
distribute-neg-in68.3%
remove-double-neg68.3%
unsub-neg68.3%
Simplified68.3%
if -1.44999999999999987e-63 < z < 2.8000000000000001e-76Initial program 96.8%
Taylor expanded in z around 0 79.3%
Final simplification78.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= z -9.5e+62)
(/ (/ x_m z) (- z y))
(if (<= z -8.2e-191)
(/ (/ x_m t) (- y z))
(if (<= z 1.65e-75) (/ x_m (* y (- t 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 <= -9.5e+62) {
tmp = (x_m / z) / (z - y);
} else if (z <= -8.2e-191) {
tmp = (x_m / t) / (y - z);
} else if (z <= 1.65e-75) {
tmp = x_m / (y * (t - 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 <= (-9.5d+62)) then
tmp = (x_m / z) / (z - y)
else if (z <= (-8.2d-191)) then
tmp = (x_m / t) / (y - z)
else if (z <= 1.65d-75) then
tmp = x_m / (y * (t - 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 <= -9.5e+62) {
tmp = (x_m / z) / (z - y);
} else if (z <= -8.2e-191) {
tmp = (x_m / t) / (y - z);
} else if (z <= 1.65e-75) {
tmp = x_m / (y * (t - 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 <= -9.5e+62: tmp = (x_m / z) / (z - y) elif z <= -8.2e-191: tmp = (x_m / t) / (y - z) elif z <= 1.65e-75: tmp = x_m / (y * (t - 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 <= -9.5e+62) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (z <= -8.2e-191) tmp = Float64(Float64(x_m / t) / Float64(y - z)); elseif (z <= 1.65e-75) tmp = Float64(x_m / Float64(y * Float64(t - 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 <= -9.5e+62)
tmp = (x_m / z) / (z - y);
elseif (z <= -8.2e-191)
tmp = (x_m / t) / (y - z);
elseif (z <= 1.65e-75)
tmp = x_m / (y * (t - 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, -9.5e+62], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.2e-191], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e-75], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $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 -9.5 \cdot 10^{+62}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-191}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-75}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\end{array}
\end{array}
if z < -9.5000000000000003e62Initial program 79.8%
Taylor expanded in t around 0 73.9%
mul-1-neg73.9%
associate-/r*91.1%
distribute-neg-frac291.1%
neg-sub091.1%
sub-neg91.1%
+-commutative91.1%
associate--r+91.1%
neg-sub091.1%
remove-double-neg91.1%
Simplified91.1%
if -9.5000000000000003e62 < z < -8.2000000000000004e-191Initial program 93.8%
associate-/l/97.9%
Simplified97.9%
Taylor expanded in t around inf 70.9%
if -8.2000000000000004e-191 < z < 1.65e-75Initial program 97.2%
Taylor expanded in y around inf 88.2%
*-commutative88.2%
Simplified88.2%
if 1.65e-75 < z Initial program 84.9%
Taylor expanded in y around 0 70.1%
mul-1-neg70.1%
associate-/r*81.3%
distribute-neg-frac281.3%
sub-neg81.3%
+-commutative81.3%
distribute-neg-in81.3%
remove-double-neg81.3%
unsub-neg81.3%
Simplified81.3%
Final simplification83.4%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (/ x_m z) z)))
(*
x_s
(if (<= z -4e+60)
t_1
(if (<= z -6e-63)
(/ (/ x_m t) (- z))
(if (<= z 3e-73) (/ 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 <= -4e+60) {
tmp = t_1;
} else if (z <= -6e-63) {
tmp = (x_m / t) / -z;
} else if (z <= 3e-73) {
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 <= (-4d+60)) then
tmp = t_1
else if (z <= (-6d-63)) then
tmp = (x_m / t) / -z
else if (z <= 3d-73) 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 <= -4e+60) {
tmp = t_1;
} else if (z <= -6e-63) {
tmp = (x_m / t) / -z;
} else if (z <= 3e-73) {
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 <= -4e+60: tmp = t_1 elif z <= -6e-63: tmp = (x_m / t) / -z elif z <= 3e-73: 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 <= -4e+60) tmp = t_1; elseif (z <= -6e-63) tmp = Float64(Float64(x_m / t) / Float64(-z)); elseif (z <= 3e-73) tmp = Float64(x_m / Float64(y * t)); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = (x_m / z) / z;
tmp = 0.0;
if (z <= -4e+60)
tmp = t_1;
elseif (z <= -6e-63)
tmp = (x_m / t) / -z;
elseif (z <= 3e-73)
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, -4e+60], t$95$1, If[LessEqual[z, -6e-63], N[(N[(x$95$m / t), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, 3e-73], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-63}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{-z}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-73}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -3.9999999999999998e60 or 3e-73 < z Initial program 82.5%
Taylor expanded in t around 0 72.8%
mul-1-neg72.8%
associate-/r*83.9%
distribute-neg-frac283.9%
neg-sub083.9%
sub-neg83.9%
+-commutative83.9%
associate--r+83.9%
neg-sub083.9%
remove-double-neg83.9%
Simplified83.9%
Taylor expanded in z around inf 72.7%
if -3.9999999999999998e60 < z < -5.99999999999999959e-63Initial program 96.0%
Taylor expanded in y around 0 59.8%
mul-1-neg59.8%
distribute-rgt-neg-in59.8%
sub-neg59.8%
+-commutative59.8%
distribute-neg-in59.8%
remove-double-neg59.8%
unsub-neg59.8%
Simplified59.8%
Taylor expanded in z around 0 55.2%
associate-*r/55.2%
neg-mul-155.2%
*-commutative55.2%
Simplified55.2%
Taylor expanded in x around 0 55.2%
mul-1-neg55.2%
associate-/r*55.2%
Simplified55.2%
if -5.99999999999999959e-63 < z < 3e-73Initial program 96.8%
Taylor expanded in z around 0 79.3%
Final simplification73.5%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= z -9.8e+86)
(/ (/ x_m z) (- z y))
(if (<= z 2.55e+141) (/ x_m (* (- y z) (- t 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 <= -9.8e+86) {
tmp = (x_m / z) / (z - y);
} else if (z <= 2.55e+141) {
tmp = x_m / ((y - z) * (t - 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 <= (-9.8d+86)) then
tmp = (x_m / z) / (z - y)
else if (z <= 2.55d+141) then
tmp = x_m / ((y - z) * (t - 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 <= -9.8e+86) {
tmp = (x_m / z) / (z - y);
} else if (z <= 2.55e+141) {
tmp = x_m / ((y - z) * (t - 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 <= -9.8e+86: tmp = (x_m / z) / (z - y) elif z <= 2.55e+141: tmp = x_m / ((y - z) * (t - 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 <= -9.8e+86) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (z <= 2.55e+141) tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - 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 <= -9.8e+86)
tmp = (x_m / z) / (z - y);
elseif (z <= 2.55e+141)
tmp = x_m / ((y - z) * (t - 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, -9.8e+86], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.55e+141], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $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 -9.8 \cdot 10^{+86}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{+141}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\end{array}
\end{array}
if z < -9.7999999999999999e86Initial program 75.3%
Taylor expanded in t around 0 70.6%
mul-1-neg70.6%
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%
if -9.7999999999999999e86 < z < 2.5499999999999999e141Initial program 96.0%
if 2.5499999999999999e141 < z Initial program 72.5%
Taylor expanded in y around 0 70.9%
mul-1-neg70.9%
associate-/r*95.8%
distribute-neg-frac295.8%
sub-neg95.8%
+-commutative95.8%
distribute-neg-in95.8%
remove-double-neg95.8%
unsub-neg95.8%
Simplified95.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 -2.8e-19) (not (<= z 1.65e-77)))
(/ (/ x_m z) (- z t))
(/ x_m (* y (- 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.8e-19) || !(z <= 1.65e-77)) {
tmp = (x_m / z) / (z - t);
} else {
tmp = x_m / (y * (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.8d-19)) .or. (.not. (z <= 1.65d-77))) then
tmp = (x_m / z) / (z - t)
else
tmp = x_m / (y * (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.8e-19) || !(z <= 1.65e-77)) {
tmp = (x_m / z) / (z - t);
} else {
tmp = x_m / (y * (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.8e-19) or not (z <= 1.65e-77): tmp = (x_m / z) / (z - t) else: tmp = x_m / (y * (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.8e-19) || !(z <= 1.65e-77)) tmp = Float64(Float64(x_m / z) / Float64(z - t)); else tmp = Float64(x_m / Float64(y * 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.8e-19) || ~((z <= 1.65e-77)))
tmp = (x_m / z) / (z - t);
else
tmp = x_m / (y * (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[Or[LessEqual[z, -2.8e-19], N[Not[LessEqual[z, 1.65e-77]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-19} \lor \neg \left(z \leq 1.65 \cdot 10^{-77}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\end{array}
\end{array}
if z < -2.80000000000000003e-19 or 1.64999999999999996e-77 < z Initial program 83.7%
Taylor expanded in y around 0 70.2%
mul-1-neg70.2%
associate-/r*81.5%
distribute-neg-frac281.5%
sub-neg81.5%
+-commutative81.5%
distribute-neg-in81.5%
remove-double-neg81.5%
unsub-neg81.5%
Simplified81.5%
if -2.80000000000000003e-19 < z < 1.64999999999999996e-77Initial program 97.1%
Taylor expanded in y around inf 84.0%
*-commutative84.0%
Simplified84.0%
Final simplification82.6%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -33000000.0) (not (<= z 3e-73)))
(/ (/ x_m z) z)
(/ x_m (* y t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -33000000.0) || !(z <= 3e-73)) {
tmp = (x_m / z) / z;
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-33000000.0d0)) .or. (.not. (z <= 3d-73))) then
tmp = (x_m / z) / z
else
tmp = x_m / (y * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -33000000.0) || !(z <= 3e-73)) {
tmp = (x_m / z) / z;
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -33000000.0) or not (z <= 3e-73): tmp = (x_m / z) / z else: tmp = x_m / (y * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -33000000.0) || !(z <= 3e-73)) tmp = Float64(Float64(x_m / z) / z); else tmp = Float64(x_m / Float64(y * t)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -33000000.0) || ~((z <= 3e-73)))
tmp = (x_m / z) / z;
else
tmp = x_m / (y * t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -33000000.0], N[Not[LessEqual[z, 3e-73]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -33000000 \lor \neg \left(z \leq 3 \cdot 10^{-73}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -3.3e7 or 3e-73 < z Initial program 83.1%
Taylor expanded in t around 0 71.8%
mul-1-neg71.8%
associate-/r*82.2%
distribute-neg-frac282.2%
neg-sub082.2%
sub-neg82.2%
+-commutative82.2%
associate--r+82.2%
neg-sub082.2%
remove-double-neg82.2%
Simplified82.2%
Taylor expanded in z around inf 68.6%
if -3.3e7 < z < 3e-73Initial program 97.2%
Taylor expanded in z around 0 73.1%
Final simplification70.6%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -5500000.0) (not (<= z 2.7e-73)))
(/ x_m (* z z))
(/ x_m (* y t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -5500000.0) || !(z <= 2.7e-73)) {
tmp = x_m / (z * z);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-5500000.0d0)) .or. (.not. (z <= 2.7d-73))) then
tmp = x_m / (z * z)
else
tmp = x_m / (y * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -5500000.0) || !(z <= 2.7e-73)) {
tmp = x_m / (z * z);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -5500000.0) or not (z <= 2.7e-73): tmp = x_m / (z * z) else: tmp = x_m / (y * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -5500000.0) || !(z <= 2.7e-73)) tmp = Float64(x_m / Float64(z * z)); else tmp = Float64(x_m / Float64(y * t)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -5500000.0) || ~((z <= 2.7e-73)))
tmp = x_m / (z * z);
else
tmp = x_m / (y * t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -5500000.0], N[Not[LessEqual[z, 2.7e-73]], $MachinePrecision]], N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -5500000 \lor \neg \left(z \leq 2.7 \cdot 10^{-73}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -5.5e6 or 2.69999999999999994e-73 < z Initial program 83.1%
Taylor expanded in y around 0 71.0%
mul-1-neg71.0%
distribute-rgt-neg-in71.0%
sub-neg71.0%
+-commutative71.0%
distribute-neg-in71.0%
remove-double-neg71.0%
unsub-neg71.0%
Simplified71.0%
Taylor expanded in z around inf 59.6%
if -5.5e6 < z < 2.69999999999999994e-73Initial program 97.2%
Taylor expanded in z around 0 73.1%
Final simplification65.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 -6800000.0) (not (<= z 4e-63)))
(/ x_m (* z t))
(/ x_m (* y t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -6800000.0) || !(z <= 4e-63)) {
tmp = x_m / (z * t);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-6800000.0d0)) .or. (.not. (z <= 4d-63))) then
tmp = x_m / (z * t)
else
tmp = x_m / (y * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -6800000.0) || !(z <= 4e-63)) {
tmp = x_m / (z * t);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -6800000.0) or not (z <= 4e-63): tmp = x_m / (z * t) else: tmp = x_m / (y * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -6800000.0) || !(z <= 4e-63)) tmp = Float64(x_m / Float64(z * t)); else tmp = Float64(x_m / Float64(y * t)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -6800000.0) || ~((z <= 4e-63)))
tmp = x_m / (z * t);
else
tmp = x_m / (y * t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -6800000.0], N[Not[LessEqual[z, 4e-63]], $MachinePrecision]], N[(x$95$m / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -6800000 \lor \neg \left(z \leq 4 \cdot 10^{-63}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -6.8e6 or 4.00000000000000027e-63 < z Initial program 82.8%
Taylor expanded in y around 0 70.6%
mul-1-neg70.6%
distribute-rgt-neg-in70.6%
sub-neg70.6%
+-commutative70.6%
distribute-neg-in70.6%
remove-double-neg70.6%
unsub-neg70.6%
Simplified70.6%
Taylor expanded in z around 0 38.0%
associate-*r/38.0%
neg-mul-138.0%
*-commutative38.0%
Simplified38.0%
add-sqr-sqrt21.4%
sqrt-unprod34.0%
sqr-neg34.0%
sqrt-unprod12.2%
add-sqr-sqrt30.0%
*-un-lft-identity30.0%
Applied egg-rr30.0%
*-lft-identity30.0%
Simplified30.0%
if -6.8e6 < z < 4.00000000000000027e-63Initial program 97.2%
Taylor expanded in z around 0 72.0%
Final simplification49.4%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x_s x_m y z t) :precision binary64 (* x_s (/ x_m (* y t))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m / (y * t));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x_s * (x_m / (y * t))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m / (y * t));
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): return x_s * (x_m / (y * t))
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(x_m / Float64(y * t))) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp = code(x_s, x_m, y, z, t)
tmp = x_s * (x_m / (y * t));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \frac{x\_m}{y \cdot t}
\end{array}
Initial program 89.5%
Taylor expanded in z around 0 45.0%
Final simplification45.0%
(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 2024157
(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))))