
(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(Float64(x * 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[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * 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[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= x_m 9e+56)
(/ (fma (- z) x_m (* x_m y)) (- t z))
(* (/ x_m (- t z)) (- y z)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (x_m <= 9e+56) {
tmp = fma(-z, x_m, (x_m * y)) / (t - z);
} else {
tmp = (x_m / (t - z)) * (y - z);
}
return x_s * tmp;
}
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (x_m <= 9e+56) tmp = Float64(fma(Float64(-z), x_m, Float64(x_m * y)) / Float64(t - z)); else tmp = Float64(Float64(x_m / Float64(t - z)) * Float64(y - z)); end return Float64(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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[x$95$m, 9e+56], N[(N[((-z) * x$95$m + N[(x$95$m * y), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 9 \cdot 10^{+56}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-z, x\_m, x\_m \cdot y\right)}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{t - z} \cdot \left(y - z\right)\\
\end{array}
\end{array}
if x < 9.0000000000000006e56Initial program 92.5%
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
accelerator-lowering-fma.f64N/A
neg-lowering-neg.f64N/A
*-commutativeN/A
*-lowering-*.f6492.5
Applied egg-rr92.5%
if 9.0000000000000006e56 < x Initial program 59.2%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6498.2
Applied egg-rr98.2%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* (/ x_m (- t z)) (- y z))) (t_2 (/ (* x_m (- y z)) (- t z))))
(*
x_s
(if (<= t_2 -2e-175) t_1 (if (<= t_2 4e-176) (/ (* x_m z) (- z t)) t_1)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / (t - z)) * (y - z);
double t_2 = (x_m * (y - z)) / (t - z);
double tmp;
if (t_2 <= -2e-175) {
tmp = t_1;
} else if (t_2 <= 4e-176) {
tmp = (x_m * z) / (z - t);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 / (t - z)) * (y - z)
t_2 = (x_m * (y - z)) / (t - z)
if (t_2 <= (-2d-175)) then
tmp = t_1
else if (t_2 <= 4d-176) 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);
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 t_2 = (x_m * (y - z)) / (t - z);
double tmp;
if (t_2 <= -2e-175) {
tmp = t_1;
} else if (t_2 <= 4e-176) {
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) def code(x_s, x_m, y, z, t): t_1 = (x_m / (t - z)) * (y - z) t_2 = (x_m * (y - z)) / (t - z) tmp = 0 if t_2 <= -2e-175: tmp = t_1 elif t_2 <= 4e-176: tmp = (x_m * z) / (z - t) else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(x_m / Float64(t - z)) * Float64(y - z)) t_2 = Float64(Float64(x_m * Float64(y - z)) / Float64(t - z)) tmp = 0.0 if (t_2 <= -2e-175) tmp = t_1; elseif (t_2 <= 4e-176) tmp = Float64(Float64(x_m * 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); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = (x_m / (t - z)) * (y - z); t_2 = (x_m * (y - z)) / (t - z); tmp = 0.0; if (t_2 <= -2e-175) tmp = t_1; elseif (t_2 <= 4e-176) 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]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$2, -2e-175], t$95$1, If[LessEqual[t$95$2, 4e-176], N[(N[(x$95$m * z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := \frac{x\_m}{t - z} \cdot \left(y - z\right)\\
t_2 := \frac{x\_m \cdot \left(y - z\right)}{t - z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-175}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-176}:\\
\;\;\;\;\frac{x\_m \cdot z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -2e-175 or 4e-176 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 80.0%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6495.1
Applied egg-rr95.1%
if -2e-175 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 4e-176Initial program 99.8%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.3
Applied egg-rr94.3%
frac-2negN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6458.1
Applied egg-rr58.1%
Taylor expanded in z around inf
Simplified52.4%
*-commutativeN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6482.8
Applied egg-rr82.8%
Final simplification92.4%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= z -3.4e+44)
x_m
(if (<= z 3.5e-39)
(* x_m (/ y t))
(if (<= z 5.4e+26) (* x_m (/ y (- z))) (fma x_m (/ t z) x_m))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -3.4e+44) {
tmp = x_m;
} else if (z <= 3.5e-39) {
tmp = x_m * (y / t);
} else if (z <= 5.4e+26) {
tmp = x_m * (y / -z);
} else {
tmp = fma(x_m, (t / z), x_m);
}
return x_s * tmp;
}
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -3.4e+44) tmp = x_m; elseif (z <= 3.5e-39) tmp = Float64(x_m * Float64(y / t)); elseif (z <= 5.4e+26) tmp = Float64(x_m * Float64(y / Float64(-z))); else tmp = fma(x_m, Float64(t / z), x_m); end return Float64(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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -3.4e+44], x$95$m, If[LessEqual[z, 3.5e-39], N[(x$95$m * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e+26], N[(x$95$m * N[(y / (-z)), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(t / z), $MachinePrecision] + x$95$m), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+44}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-39}:\\
\;\;\;\;x\_m \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+26}:\\
\;\;\;\;x\_m \cdot \frac{y}{-z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x\_m, \frac{t}{z}, x\_m\right)\\
\end{array}
\end{array}
if z < -3.4e44Initial program 73.6%
Taylor expanded in z around inf
Simplified57.5%
if -3.4e44 < z < 3.5e-39Initial program 93.6%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.9
Applied egg-rr94.9%
Taylor expanded in z around 0
/-lowering-/.f6463.8
Simplified63.8%
if 3.5e-39 < z < 5.4e26Initial program 90.3%
Taylor expanded in t around 0
mul-1-negN/A
neg-sub0N/A
associate-/l*N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-/l*N/A
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6469.2
Simplified69.2%
Taylor expanded in y around inf
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
neg-lowering-neg.f6449.4
Simplified49.4%
if 5.4e26 < z Initial program 73.9%
Taylor expanded in y around 0
mul-1-negN/A
neg-lowering-neg.f6460.8
Simplified60.8%
Taylor expanded in z around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6460.6
Simplified60.6%
Final simplification60.6%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* x_m (/ (- y z) t))))
(*
x_s
(if (<= t -11200000000000.0)
t_1
(if (<= t 7.2e+98) (fma (/ y (- z)) x_m x_m) t_1)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m * ((y - z) / t);
double tmp;
if (t <= -11200000000000.0) {
tmp = t_1;
} else if (t <= 7.2e+98) {
tmp = fma((y / -z), x_m, x_m);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m * Float64(Float64(y - z) / t)) tmp = 0.0 if (t <= -11200000000000.0) tmp = t_1; elseif (t <= 7.2e+98) tmp = fma(Float64(y / Float64(-z)), x_m, x_m); else tmp = t_1; end return Float64(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]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -11200000000000.0], t$95$1, If[LessEqual[t, 7.2e+98], N[(N[(y / (-z)), $MachinePrecision] * x$95$m + x$95$m), $MachinePrecision], t$95$1]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := x\_m \cdot \frac{y - z}{t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -11200000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{-z}, x\_m, x\_m\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -1.12e13 or 7.19999999999999962e98 < t Initial program 82.8%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.9
Applied egg-rr94.9%
Taylor expanded in t around inf
Simplified84.4%
if -1.12e13 < t < 7.19999999999999962e98Initial program 85.6%
Taylor expanded in t around 0
mul-1-negN/A
neg-sub0N/A
associate-/l*N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-/l*N/A
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6479.0
Simplified79.0%
sub-negN/A
+-commutativeN/A
distribute-lft-neg-inN/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
clear-numN/A
/-rgt-identityN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f6481.3
Applied egg-rr81.3%
Final simplification82.6%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* x_m (/ (- y z) t))))
(*
x_s
(if (<= t -1.34e+14)
t_1
(if (<= t 9e+98) (fma (/ x_m (- z)) y x_m) t_1)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m * ((y - z) / t);
double tmp;
if (t <= -1.34e+14) {
tmp = t_1;
} else if (t <= 9e+98) {
tmp = fma((x_m / -z), y, x_m);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m * Float64(Float64(y - z) / t)) tmp = 0.0 if (t <= -1.34e+14) tmp = t_1; elseif (t <= 9e+98) tmp = fma(Float64(x_m / Float64(-z)), y, x_m); else tmp = t_1; end return Float64(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]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -1.34e+14], t$95$1, If[LessEqual[t, 9e+98], N[(N[(x$95$m / (-z)), $MachinePrecision] * y + x$95$m), $MachinePrecision], t$95$1]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := x\_m \cdot \frac{y - z}{t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.34 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x\_m}{-z}, y, x\_m\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -1.34e14 or 9.0000000000000004e98 < t Initial program 82.8%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.9
Applied egg-rr94.9%
Taylor expanded in t around inf
Simplified84.4%
if -1.34e14 < t < 9.0000000000000004e98Initial program 85.6%
Taylor expanded in t around 0
mul-1-negN/A
neg-sub0N/A
associate-/l*N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-/l*N/A
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6479.0
Simplified79.0%
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f6479.0
Applied egg-rr79.0%
Final simplification81.2%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* x_m (/ (- y z) t))))
(*
x_s
(if (<= t -2150000000000.0)
t_1
(if (<= t 7.2e+98) (- x_m (* y (/ x_m z))) t_1)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m * ((y - z) / t);
double tmp;
if (t <= -2150000000000.0) {
tmp = t_1;
} else if (t <= 7.2e+98) {
tmp = x_m - (y * (x_m / z));
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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)
if (t <= (-2150000000000.0d0)) then
tmp = t_1
else if (t <= 7.2d+98) then
tmp = x_m - (y * (x_m / z))
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m * ((y - z) / t);
double tmp;
if (t <= -2150000000000.0) {
tmp = t_1;
} else if (t <= 7.2e+98) {
tmp = x_m - (y * (x_m / z));
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = x_m * ((y - z) / t) tmp = 0 if t <= -2150000000000.0: tmp = t_1 elif t <= 7.2e+98: tmp = x_m - (y * (x_m / z)) else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m * Float64(Float64(y - z) / t)) tmp = 0.0 if (t <= -2150000000000.0) tmp = t_1; elseif (t <= 7.2e+98) tmp = Float64(x_m - Float64(y * Float64(x_m / z))); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = x_m * ((y - z) / t); tmp = 0.0; if (t <= -2150000000000.0) tmp = t_1; elseif (t <= 7.2e+98) tmp = x_m - (y * (x_m / z)); else tmp = t_1; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -2150000000000.0], t$95$1, If[LessEqual[t, 7.2e+98], N[(x$95$m - N[(y * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := x\_m \cdot \frac{y - z}{t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2150000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+98}:\\
\;\;\;\;x\_m - y \cdot \frac{x\_m}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -2.15e12 or 7.19999999999999962e98 < t Initial program 82.8%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.9
Applied egg-rr94.9%
Taylor expanded in t around inf
Simplified84.4%
if -2.15e12 < t < 7.19999999999999962e98Initial program 85.6%
Taylor expanded in t around 0
mul-1-negN/A
neg-sub0N/A
associate-/l*N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-/l*N/A
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6479.0
Simplified79.0%
Final simplification81.2%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* x_m (/ z (- z t)))))
(*
x_s
(if (<= z -155000000.0)
t_1
(if (<= z 1.95e+34) (* x_m (/ y (- t z))) t_1)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m * (z / (z - t));
double tmp;
if (z <= -155000000.0) {
tmp = t_1;
} else if (z <= 1.95e+34) {
tmp = x_m * (y / (t - z));
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 - t))
if (z <= (-155000000.0d0)) then
tmp = t_1
else if (z <= 1.95d+34) then
tmp = x_m * (y / (t - z))
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
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 tmp;
if (z <= -155000000.0) {
tmp = t_1;
} else if (z <= 1.95e+34) {
tmp = x_m * (y / (t - z));
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = x_m * (z / (z - t)) tmp = 0 if z <= -155000000.0: tmp = t_1 elif z <= 1.95e+34: tmp = x_m * (y / (t - z)) else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m * Float64(z / Float64(z - t))) tmp = 0.0 if (z <= -155000000.0) tmp = t_1; elseif (z <= 1.95e+34) tmp = Float64(x_m * Float64(y / Float64(t - z))); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = x_m * (z / (z - t)); tmp = 0.0; if (z <= -155000000.0) tmp = t_1; elseif (z <= 1.95e+34) tmp = x_m * (y / (t - z)); else tmp = t_1; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
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]}, N[(x$95$s * If[LessEqual[z, -155000000.0], t$95$1, If[LessEqual[z, 1.95e+34], N[(x$95$m * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := x\_m \cdot \frac{z}{z - t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -155000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+34}:\\
\;\;\;\;x\_m \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -1.55e8 or 1.9500000000000001e34 < z Initial program 74.2%
Taylor expanded in y around 0
mul-1-negN/A
neg-lowering-neg.f6462.6
Simplified62.6%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6479.7
Applied egg-rr79.7%
if -1.55e8 < z < 1.9500000000000001e34Initial program 93.1%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6476.7
Simplified76.7%
Final simplification78.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* x_m (/ y (- t z)))))
(*
x_s
(if (<= y -1.4e-65) t_1 (if (<= y 2.1e-97) (* z (/ x_m (- z t))) t_1)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m * (y / (t - z));
double tmp;
if (y <= -1.4e-65) {
tmp = t_1;
} else if (y <= 2.1e-97) {
tmp = z * (x_m / (z - t));
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x_m * (y / (t - z))
if (y <= (-1.4d-65)) then
tmp = t_1
else if (y <= 2.1d-97) then
tmp = z * (x_m / (z - t))
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m * (y / (t - z));
double tmp;
if (y <= -1.4e-65) {
tmp = t_1;
} else if (y <= 2.1e-97) {
tmp = z * (x_m / (z - t));
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = x_m * (y / (t - z)) tmp = 0 if y <= -1.4e-65: tmp = t_1 elif y <= 2.1e-97: tmp = z * (x_m / (z - t)) else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m * Float64(y / Float64(t - z))) tmp = 0.0 if (y <= -1.4e-65) tmp = t_1; elseif (y <= 2.1e-97) tmp = Float64(z * Float64(x_m / 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); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = x_m * (y / (t - z)); tmp = 0.0; if (y <= -1.4e-65) tmp = t_1; elseif (y <= 2.1e-97) tmp = z * (x_m / (z - t)); else tmp = t_1; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -1.4e-65], t$95$1, If[LessEqual[y, 2.1e-97], N[(z * N[(x$95$m / 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)
\\
\begin{array}{l}
t_1 := x\_m \cdot \frac{y}{t - z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-97}:\\
\;\;\;\;z \cdot \frac{x\_m}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if y < -1.4e-65 or 2.1000000000000001e-97 < y Initial program 82.9%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6470.2
Simplified70.2%
if -1.4e-65 < y < 2.1000000000000001e-97Initial program 87.8%
Taylor expanded in y around 0
mul-1-negN/A
neg-lowering-neg.f6481.4
Simplified81.4%
frac-2negN/A
div-invN/A
distribute-rgt-neg-outN/A
remove-double-negN/A
*-commutativeN/A
associate-*l*N/A
div-invN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6484.9
Applied egg-rr84.9%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= z -2e+95)
x_m
(if (<= z 1.1e+59) (* x_m (/ y (- t z))) (fma x_m (/ t z) x_m)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -2e+95) {
tmp = x_m;
} else if (z <= 1.1e+59) {
tmp = x_m * (y / (t - z));
} else {
tmp = fma(x_m, (t / z), x_m);
}
return x_s * tmp;
}
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -2e+95) tmp = x_m; elseif (z <= 1.1e+59) tmp = Float64(x_m * Float64(y / Float64(t - z))); else tmp = fma(x_m, Float64(t / z), x_m); end return Float64(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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -2e+95], x$95$m, If[LessEqual[z, 1.1e+59], N[(x$95$m * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(t / z), $MachinePrecision] + x$95$m), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+95}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+59}:\\
\;\;\;\;x\_m \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x\_m, \frac{t}{z}, x\_m\right)\\
\end{array}
\end{array}
if z < -2.00000000000000004e95Initial program 71.9%
Taylor expanded in z around inf
Simplified62.1%
if -2.00000000000000004e95 < z < 1.1e59Initial program 92.3%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6473.3
Simplified73.3%
if 1.1e59 < z Initial program 70.9%
Taylor expanded in y around 0
mul-1-negN/A
neg-lowering-neg.f6461.9
Simplified61.9%
Taylor expanded in z around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6463.4
Simplified63.4%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= z -1.95e+43)
x_m
(if (<= z 0.0005) (* x_m (/ y t)) (fma x_m (/ t z) x_m)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -1.95e+43) {
tmp = x_m;
} else if (z <= 0.0005) {
tmp = x_m * (y / t);
} else {
tmp = fma(x_m, (t / z), x_m);
}
return x_s * tmp;
}
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -1.95e+43) tmp = x_m; elseif (z <= 0.0005) tmp = Float64(x_m * Float64(y / t)); else tmp = fma(x_m, Float64(t / z), x_m); end return Float64(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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -1.95e+43], x$95$m, If[LessEqual[z, 0.0005], N[(x$95$m * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(t / z), $MachinePrecision] + x$95$m), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+43}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;z \leq 0.0005:\\
\;\;\;\;x\_m \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x\_m, \frac{t}{z}, x\_m\right)\\
\end{array}
\end{array}
if z < -1.95e43Initial program 73.6%
Taylor expanded in z around inf
Simplified57.5%
if -1.95e43 < z < 5.0000000000000001e-4Initial program 93.4%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6495.3
Applied egg-rr95.3%
Taylor expanded in z around 0
/-lowering-/.f6461.4
Simplified61.4%
if 5.0000000000000001e-4 < z Initial program 76.1%
Taylor expanded in y around 0
mul-1-negN/A
neg-lowering-neg.f6457.5
Simplified57.5%
Taylor expanded in z around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6455.8
Simplified55.8%
Final simplification59.1%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= z -7.2e+43) x_m (if (<= z 3.6e-31) (* x_m (/ y t)) x_m))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -7.2e+43) {
tmp = x_m;
} else if (z <= 3.6e-31) {
tmp = x_m * (y / t);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 <= (-7.2d+43)) then
tmp = x_m
else if (z <= 3.6d-31) then
tmp = x_m * (y / t)
else
tmp = x_m
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -7.2e+43) {
tmp = x_m;
} else if (z <= 3.6e-31) {
tmp = x_m * (y / t);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if z <= -7.2e+43: tmp = x_m elif z <= 3.6e-31: tmp = x_m * (y / t) else: tmp = x_m return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -7.2e+43) tmp = x_m; elseif (z <= 3.6e-31) tmp = Float64(x_m * Float64(y / t)); else tmp = x_m; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (z <= -7.2e+43) tmp = x_m; elseif (z <= 3.6e-31) tmp = x_m * (y / t); else tmp = x_m; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -7.2e+43], x$95$m, If[LessEqual[z, 3.6e-31], N[(x$95$m * N[(y / t), $MachinePrecision]), $MachinePrecision], x$95$m]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+43}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-31}:\\
\;\;\;\;x\_m \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -7.2000000000000002e43 or 3.60000000000000004e-31 < z Initial program 75.9%
Taylor expanded in z around inf
Simplified54.0%
if -7.2000000000000002e43 < z < 3.60000000000000004e-31Initial program 93.7%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.9
Applied egg-rr94.9%
Taylor expanded in z around 0
/-lowering-/.f6464.1
Simplified64.1%
Final simplification58.9%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= z -1.65e+43) x_m (if (<= z 6e-30) (* y (/ x_m t)) x_m))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -1.65e+43) {
tmp = x_m;
} else if (z <= 6e-30) {
tmp = y * (x_m / t);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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.65d+43)) then
tmp = x_m
else if (z <= 6d-30) then
tmp = y * (x_m / t)
else
tmp = x_m
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -1.65e+43) {
tmp = x_m;
} else if (z <= 6e-30) {
tmp = y * (x_m / t);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if z <= -1.65e+43: tmp = x_m elif z <= 6e-30: tmp = y * (x_m / t) else: tmp = x_m return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -1.65e+43) tmp = x_m; elseif (z <= 6e-30) tmp = Float64(y * Float64(x_m / t)); else tmp = x_m; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (z <= -1.65e+43) tmp = x_m; elseif (z <= 6e-30) tmp = y * (x_m / t); else tmp = x_m; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -1.65e+43], x$95$m, If[LessEqual[z, 6e-30], N[(y * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision], x$95$m]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+43}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-30}:\\
\;\;\;\;y \cdot \frac{x\_m}{t}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -1.6500000000000001e43 or 5.9999999999999998e-30 < z Initial program 75.9%
Taylor expanded in z around inf
Simplified54.0%
if -1.6500000000000001e43 < z < 5.9999999999999998e-30Initial program 93.7%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.9
Applied egg-rr94.9%
Taylor expanded in z around 0
/-lowering-/.f6464.1
Simplified64.1%
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6459.4
Applied egg-rr59.4%
Final simplification56.6%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= x_m 1e+57) (/ (* x_m (- y z)) (- t z)) (* (/ x_m (- t z)) (- y z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (x_m <= 1e+57) {
tmp = (x_m * (y - z)) / (t - z);
} else {
tmp = (x_m / (t - z)) * (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x_m <= 1d+57) then
tmp = (x_m * (y - z)) / (t - z)
else
tmp = (x_m / (t - z)) * (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (x_m <= 1e+57) {
tmp = (x_m * (y - z)) / (t - z);
} else {
tmp = (x_m / (t - z)) * (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if x_m <= 1e+57: tmp = (x_m * (y - z)) / (t - z) else: tmp = (x_m / (t - z)) * (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (x_m <= 1e+57) tmp = Float64(Float64(x_m * Float64(y - z)) / Float64(t - z)); else tmp = Float64(Float64(x_m / Float64(t - z)) * Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (x_m <= 1e+57) tmp = (x_m * (y - z)) / (t - z); else tmp = (x_m / (t - z)) * (y - z); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[x$95$m, 1e+57], N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 10^{+57}:\\
\;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{t - z} \cdot \left(y - z\right)\\
\end{array}
\end{array}
if x < 1.00000000000000005e57Initial program 92.5%
if 1.00000000000000005e57 < x Initial program 59.2%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6498.2
Applied egg-rr98.2%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (* x_m (/ (- y z) (- t z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m * ((y - z) / (t - z)));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 - z) / (t - z)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m * ((y - z) / (t - z)));
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): return x_s * (x_m * ((y - z) / (t - z)))
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(x_m * Float64(Float64(y - z) / Float64(t - z)))) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z, t) tmp = x_s * (x_m * ((y - z) / (t - z))); 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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \left(x\_m \cdot \frac{y - z}{t - z}\right)
\end{array}
Initial program 84.4%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.4
Applied egg-rr97.4%
Final simplification97.4%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s x_m))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * x_m;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * x_m;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): return x_s * x_m
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) return Float64(x_s * x_m) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z, t) tmp = x_s * 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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * x$95$m), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot x\_m
\end{array}
Initial program 84.4%
Taylor expanded in z around inf
Simplified32.1%
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - 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 / ((t - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
def code(x, y, z, t): return x / ((t - z) / (y - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(t - z) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) / (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
herbie shell --seed 2024198
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (/ x (/ (- t z) (- y z))))
(/ (* x (- y z)) (- t z)))