
(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 14 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 2.7e-18)
(/ (* x_m (- y z)) (- t z))
(* (/ x_m (+ t z)) (* (- y z) (/ (+ t 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) {
double tmp;
if (x_m <= 2.7e-18) {
tmp = (x_m * (y - z)) / (t - z);
} else {
tmp = (x_m / (t + z)) * ((y - z) * ((t + z) / (t - 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 <= 2.7d-18) then
tmp = (x_m * (y - z)) / (t - z)
else
tmp = (x_m / (t + z)) * ((y - z) * ((t + z) / (t - 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 <= 2.7e-18) {
tmp = (x_m * (y - z)) / (t - z);
} else {
tmp = (x_m / (t + z)) * ((y - z) * ((t + z) / (t - 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 <= 2.7e-18: tmp = (x_m * (y - z)) / (t - z) else: tmp = (x_m / (t + z)) * ((y - z) * ((t + z) / (t - 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 <= 2.7e-18) tmp = Float64(Float64(x_m * Float64(y - z)) / Float64(t - z)); else tmp = Float64(Float64(x_m / Float64(t + z)) * Float64(Float64(y - z) * Float64(Float64(t + z) / Float64(t - 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 <= 2.7e-18) tmp = (x_m * (y - z)) / (t - z); else tmp = (x_m / (t + z)) * ((y - z) * ((t + z) / (t - z))); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[x$95$m, 2.7e-18], 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[(N[(y - z), $MachinePrecision] * N[(N[(t + z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $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 2.7 \cdot 10^{-18}:\\
\;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{t + z} \cdot \left(\left(y - z\right) \cdot \frac{t + z}{t - z}\right)\\
\end{array}
\end{array}
if x < 2.69999999999999989e-18Initial program 90.1%
if 2.69999999999999989e-18 < x Initial program 74.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6496.6
Applied rewrites96.6%
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/l/N/A
difference-of-squaresN/A
lift--.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6496.7
Applied rewrites96.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
div-invN/A
lift--.f64N/A
lift-/.f64N/A
clear-numN/A
times-fracN/A
*-commutativeN/A
times-fracN/A
un-div-invN/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
Applied rewrites98.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
(if (<= z -1.26e+124)
(fma (/ x_m z) t x_m)
(if (or (<= z -6e-89) (not (<= z 2.16e-32)))
(* (/ x_m (- z t)) z)
(* (/ x_m t) y)))))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.26e+124) {
tmp = fma((x_m / z), t, x_m);
} else if ((z <= -6e-89) || !(z <= 2.16e-32)) {
tmp = (x_m / (z - t)) * z;
} else {
tmp = (x_m / t) * y;
}
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.26e+124) tmp = fma(Float64(x_m / z), t, x_m); elseif ((z <= -6e-89) || !(z <= 2.16e-32)) tmp = Float64(Float64(x_m / Float64(z - t)) * z); else tmp = Float64(Float64(x_m / t) * y); 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.26e+124], N[(N[(x$95$m / z), $MachinePrecision] * t + x$95$m), $MachinePrecision], If[Or[LessEqual[z, -6e-89], N[Not[LessEqual[z, 2.16e-32]], $MachinePrecision]], N[(N[(x$95$m / N[(z - t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] * y), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.26 \cdot 10^{+124}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x\_m}{z}, t, x\_m\right)\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-89} \lor \neg \left(z \leq 2.16 \cdot 10^{-32}\right):\\
\;\;\;\;\frac{x\_m}{z - t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{t} \cdot y\\
\end{array}
\end{array}
if z < -1.26e124Initial program 63.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6460.3
Applied rewrites60.3%
Taylor expanded in z around inf
Applied rewrites81.3%
if -1.26e124 < z < -5.9999999999999999e-89 or 2.1600000000000001e-32 < z Initial program 86.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6498.7
Applied rewrites98.7%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6462.6
Applied rewrites62.6%
Applied rewrites62.3%
if -5.9999999999999999e-89 < z < 2.1600000000000001e-32Initial program 93.4%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6473.4
Applied rewrites73.4%
Applied rewrites75.0%
Final simplification70.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
(let* ((t_1 (fma (/ y (- z)) x_m x_m)))
(*
x_s
(if (<= z -6.2e+133)
t_1
(if (<= z -1.06e-32)
(/ (* z x_m) (- z t))
(if (<= z 4.4e-27) (* (/ x_m (- t z)) y) 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 = fma((y / -z), x_m, x_m);
double tmp;
if (z <= -6.2e+133) {
tmp = t_1;
} else if (z <= -1.06e-32) {
tmp = (z * x_m) / (z - t);
} else if (z <= 4.4e-27) {
tmp = (x_m / (t - z)) * y;
} 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 = fma(Float64(y / Float64(-z)), x_m, x_m) tmp = 0.0 if (z <= -6.2e+133) tmp = t_1; elseif (z <= -1.06e-32) tmp = Float64(Float64(z * x_m) / Float64(z - t)); elseif (z <= 4.4e-27) tmp = Float64(Float64(x_m / Float64(t - z)) * y); 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[(N[(y / (-z)), $MachinePrecision] * x$95$m + x$95$m), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -6.2e+133], t$95$1, If[LessEqual[z, -1.06e-32], N[(N[(z * x$95$m), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e-27], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $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 := \mathsf{fma}\left(\frac{y}{-z}, x\_m, x\_m\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.06 \cdot 10^{-32}:\\
\;\;\;\;\frac{z \cdot x\_m}{z - t}\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-27}:\\
\;\;\;\;\frac{x\_m}{t - z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -6.2e133 or 4.39999999999999974e-27 < z Initial program 70.8%
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
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites75.2%
if -6.2e133 < z < -1.05999999999999994e-32Initial program 97.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6472.2
Applied rewrites72.2%
if -1.05999999999999994e-32 < z < 4.39999999999999974e-27Initial program 94.0%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6483.5
Applied rewrites83.5%
Final simplification79.0%
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 -9e+173)
(/ x_m 1.0)
(if (<= z -1.06e-32)
(/ (* z x_m) (- z t))
(if (<= z 3.8e-28) (* (/ x_m (- t z)) y) (* (/ x_m (- 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) {
double tmp;
if (z <= -9e+173) {
tmp = x_m / 1.0;
} else if (z <= -1.06e-32) {
tmp = (z * x_m) / (z - t);
} else if (z <= 3.8e-28) {
tmp = (x_m / (t - z)) * y;
} else {
tmp = (x_m / (z - t)) * z;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-9d+173)) then
tmp = x_m / 1.0d0
else if (z <= (-1.06d-32)) then
tmp = (z * x_m) / (z - t)
else if (z <= 3.8d-28) then
tmp = (x_m / (t - z)) * y
else
tmp = (x_m / (z - t)) * z
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -9e+173) {
tmp = x_m / 1.0;
} else if (z <= -1.06e-32) {
tmp = (z * x_m) / (z - t);
} else if (z <= 3.8e-28) {
tmp = (x_m / (t - z)) * y;
} else {
tmp = (x_m / (z - t)) * z;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if z <= -9e+173: tmp = x_m / 1.0 elif z <= -1.06e-32: tmp = (z * x_m) / (z - t) elif z <= 3.8e-28: tmp = (x_m / (t - z)) * y else: tmp = (x_m / (z - t)) * z return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -9e+173) tmp = Float64(x_m / 1.0); elseif (z <= -1.06e-32) tmp = Float64(Float64(z * x_m) / Float64(z - t)); elseif (z <= 3.8e-28) tmp = Float64(Float64(x_m / Float64(t - z)) * y); else tmp = Float64(Float64(x_m / Float64(z - t)) * z); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (z <= -9e+173) tmp = x_m / 1.0; elseif (z <= -1.06e-32) tmp = (z * x_m) / (z - t); elseif (z <= 3.8e-28) tmp = (x_m / (t - z)) * y; else tmp = (x_m / (z - t)) * z; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -9e+173], N[(x$95$m / 1.0), $MachinePrecision], If[LessEqual[z, -1.06e-32], N[(N[(z * x$95$m), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-28], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(N[(x$95$m / N[(z - t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+173}:\\
\;\;\;\;\frac{x\_m}{1}\\
\mathbf{elif}\;z \leq -1.06 \cdot 10^{-32}:\\
\;\;\;\;\frac{z \cdot x\_m}{z - t}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-28}:\\
\;\;\;\;\frac{x\_m}{t - z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z - t} \cdot z\\
\end{array}
\end{array}
if z < -9.0000000000000004e173Initial program 56.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites88.8%
if -9.0000000000000004e173 < z < -1.05999999999999994e-32Initial program 93.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6470.7
Applied rewrites70.7%
if -1.05999999999999994e-32 < z < 3.80000000000000009e-28Initial program 93.9%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6483.4
Applied rewrites83.4%
if 3.80000000000000009e-28 < z Initial program 77.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6459.3
Applied rewrites59.3%
Applied rewrites61.0%
Final simplification76.8%
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 -9e+173)
(/ x_m 1.0)
(if (<= z -8e-28)
(/ (* z x_m) (- z t))
(if (<= z 2.15e-29) (* (/ x_m t) (- y z)) (* (/ x_m (- 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) {
double tmp;
if (z <= -9e+173) {
tmp = x_m / 1.0;
} else if (z <= -8e-28) {
tmp = (z * x_m) / (z - t);
} else if (z <= 2.15e-29) {
tmp = (x_m / t) * (y - z);
} else {
tmp = (x_m / (z - t)) * 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 (z <= (-9d+173)) then
tmp = x_m / 1.0d0
else if (z <= (-8d-28)) then
tmp = (z * x_m) / (z - t)
else if (z <= 2.15d-29) then
tmp = (x_m / t) * (y - z)
else
tmp = (x_m / (z - t)) * z
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -9e+173) {
tmp = x_m / 1.0;
} else if (z <= -8e-28) {
tmp = (z * x_m) / (z - t);
} else if (z <= 2.15e-29) {
tmp = (x_m / t) * (y - z);
} else {
tmp = (x_m / (z - t)) * 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 z <= -9e+173: tmp = x_m / 1.0 elif z <= -8e-28: tmp = (z * x_m) / (z - t) elif z <= 2.15e-29: tmp = (x_m / t) * (y - z) else: tmp = (x_m / (z - t)) * 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 (z <= -9e+173) tmp = Float64(x_m / 1.0); elseif (z <= -8e-28) tmp = Float64(Float64(z * x_m) / Float64(z - t)); elseif (z <= 2.15e-29) tmp = Float64(Float64(x_m / t) * Float64(y - z)); else tmp = Float64(Float64(x_m / Float64(z - t)) * z); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (z <= -9e+173) tmp = x_m / 1.0; elseif (z <= -8e-28) tmp = (z * x_m) / (z - t); elseif (z <= 2.15e-29) tmp = (x_m / t) * (y - z); else tmp = (x_m / (z - t)) * z; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -9e+173], N[(x$95$m / 1.0), $MachinePrecision], If[LessEqual[z, -8e-28], N[(N[(z * x$95$m), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.15e-29], N[(N[(x$95$m / t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(z - t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+173}:\\
\;\;\;\;\frac{x\_m}{1}\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-28}:\\
\;\;\;\;\frac{z \cdot x\_m}{z - t}\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-29}:\\
\;\;\;\;\frac{x\_m}{t} \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z - t} \cdot z\\
\end{array}
\end{array}
if z < -9.0000000000000004e173Initial program 56.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites88.8%
if -9.0000000000000004e173 < z < -7.99999999999999977e-28Initial program 92.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6470.9
Applied rewrites70.9%
if -7.99999999999999977e-28 < z < 2.1499999999999999e-29Initial program 94.0%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.1
Applied rewrites79.1%
Applied rewrites78.9%
if 2.1499999999999999e-29 < z Initial program 77.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6459.3
Applied rewrites59.3%
Applied rewrites61.0%
Final simplification74.7%
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 -9e+173)
(/ x_m 1.0)
(if (<= z -5.1e-89)
(/ (* z x_m) (- z t))
(if (<= z 2.16e-32) (* (/ x_m t) y) (* (/ x_m (- 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) {
double tmp;
if (z <= -9e+173) {
tmp = x_m / 1.0;
} else if (z <= -5.1e-89) {
tmp = (z * x_m) / (z - t);
} else if (z <= 2.16e-32) {
tmp = (x_m / t) * y;
} else {
tmp = (x_m / (z - t)) * 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 (z <= (-9d+173)) then
tmp = x_m / 1.0d0
else if (z <= (-5.1d-89)) then
tmp = (z * x_m) / (z - t)
else if (z <= 2.16d-32) then
tmp = (x_m / t) * y
else
tmp = (x_m / (z - t)) * z
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -9e+173) {
tmp = x_m / 1.0;
} else if (z <= -5.1e-89) {
tmp = (z * x_m) / (z - t);
} else if (z <= 2.16e-32) {
tmp = (x_m / t) * y;
} else {
tmp = (x_m / (z - t)) * 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 z <= -9e+173: tmp = x_m / 1.0 elif z <= -5.1e-89: tmp = (z * x_m) / (z - t) elif z <= 2.16e-32: tmp = (x_m / t) * y else: tmp = (x_m / (z - t)) * 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 (z <= -9e+173) tmp = Float64(x_m / 1.0); elseif (z <= -5.1e-89) tmp = Float64(Float64(z * x_m) / Float64(z - t)); elseif (z <= 2.16e-32) tmp = Float64(Float64(x_m / t) * y); else tmp = Float64(Float64(x_m / Float64(z - t)) * z); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (z <= -9e+173) tmp = x_m / 1.0; elseif (z <= -5.1e-89) tmp = (z * x_m) / (z - t); elseif (z <= 2.16e-32) tmp = (x_m / t) * y; else tmp = (x_m / (z - t)) * z; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -9e+173], N[(x$95$m / 1.0), $MachinePrecision], If[LessEqual[z, -5.1e-89], N[(N[(z * x$95$m), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.16e-32], N[(N[(x$95$m / t), $MachinePrecision] * y), $MachinePrecision], N[(N[(x$95$m / N[(z - t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+173}:\\
\;\;\;\;\frac{x\_m}{1}\\
\mathbf{elif}\;z \leq -5.1 \cdot 10^{-89}:\\
\;\;\;\;\frac{z \cdot x\_m}{z - t}\\
\mathbf{elif}\;z \leq 2.16 \cdot 10^{-32}:\\
\;\;\;\;\frac{x\_m}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z - t} \cdot z\\
\end{array}
\end{array}
if z < -9.0000000000000004e173Initial program 56.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites88.8%
if -9.0000000000000004e173 < z < -5.10000000000000004e-89Initial program 94.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6497.8
Applied rewrites97.8%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6467.7
Applied rewrites67.7%
if -5.10000000000000004e-89 < z < 2.1600000000000001e-32Initial program 93.4%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6473.4
Applied rewrites73.4%
Applied rewrites75.0%
if 2.1600000000000001e-32 < z Initial program 77.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6459.3
Applied rewrites59.3%
Applied rewrites61.0%
Final simplification71.7%
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.6e+111)
(* (/ z (- z t)) x_m)
(if (<= z 1.7e+209)
(* (/ x_m (- t z)) (- y z))
(fma x_m (/ (- y 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.6e+111) {
tmp = (z / (z - t)) * x_m;
} else if (z <= 1.7e+209) {
tmp = (x_m / (t - z)) * (y - z);
} else {
tmp = fma(x_m, ((y - 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.6e+111) tmp = Float64(Float64(z / Float64(z - t)) * x_m); elseif (z <= 1.7e+209) tmp = Float64(Float64(x_m / Float64(t - z)) * Float64(y - z)); else tmp = fma(x_m, Float64(Float64(y - t) / Float64(-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.6e+111], N[(N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], If[LessEqual[z, 1.7e+209], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(N[(y - t), $MachinePrecision] / (-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.6 \cdot 10^{+111}:\\
\;\;\;\;\frac{z}{z - t} \cdot x\_m\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+209}:\\
\;\;\;\;\frac{x\_m}{t - z} \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x\_m, \frac{y - t}{-z}, x\_m\right)\\
\end{array}
\end{array}
if z < -3.6000000000000002e111Initial program 64.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6494.7
Applied rewrites94.7%
if -3.6000000000000002e111 < z < 1.6999999999999998e209Initial program 91.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6494.5
Applied rewrites94.5%
if 1.6999999999999998e209 < z Initial program 72.5%
Taylor expanded in z around inf
mul-1-negN/A
unsub-negN/A
associate--r+N/A
mul-1-negN/A
sub-negN/A
div-subN/A
unsub-negN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-out--N/A
mul-1-negN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites88.3%
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 (or (<= z -1.2e-32) (not (<= z 3.8e-28)))
(* (/ z (- z t)) x_m)
(* (/ x_m (- t z)) y))))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.2e-32) || !(z <= 3.8e-28)) {
tmp = (z / (z - t)) * x_m;
} else {
tmp = (x_m / (t - z)) * y;
}
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.2d-32)) .or. (.not. (z <= 3.8d-28))) then
tmp = (z / (z - t)) * x_m
else
tmp = (x_m / (t - z)) * y
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1.2e-32) || !(z <= 3.8e-28)) {
tmp = (z / (z - t)) * x_m;
} else {
tmp = (x_m / (t - z)) * y;
}
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.2e-32) or not (z <= 3.8e-28): tmp = (z / (z - t)) * x_m else: tmp = (x_m / (t - z)) * y 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.2e-32) || !(z <= 3.8e-28)) tmp = Float64(Float64(z / Float64(z - t)) * x_m); else tmp = Float64(Float64(x_m / Float64(t - z)) * y); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if ((z <= -1.2e-32) || ~((z <= 3.8e-28))) tmp = (z / (z - t)) * x_m; else tmp = (x_m / (t - z)) * y; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -1.2e-32], N[Not[LessEqual[z, 3.8e-28]], $MachinePrecision]], N[(N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-32} \lor \neg \left(z \leq 3.8 \cdot 10^{-28}\right):\\
\;\;\;\;\frac{z}{z - t} \cdot x\_m\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{t - z} \cdot y\\
\end{array}
\end{array}
if z < -1.2000000000000001e-32 or 3.80000000000000009e-28 < z Initial program 78.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6478.1
Applied rewrites78.1%
if -1.2000000000000001e-32 < z < 3.80000000000000009e-28Initial program 93.9%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6483.4
Applied rewrites83.4%
Final simplification80.8%
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 (or (<= z -8e-28) (not (<= z 1.62e+75)))
(fma (/ x_m z) t 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 <= -8e-28) || !(z <= 1.62e+75)) {
tmp = fma((x_m / z), t, x_m);
} else {
tmp = (y / t) * 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 <= -8e-28) || !(z <= 1.62e+75)) tmp = fma(Float64(x_m / z), t, x_m); else tmp = Float64(Float64(y / t) * 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[Or[LessEqual[z, -8e-28], N[Not[LessEqual[z, 1.62e+75]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] * t + x$95$m), $MachinePrecision], N[(N[(y / t), $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 -8 \cdot 10^{-28} \lor \neg \left(z \leq 1.62 \cdot 10^{+75}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x\_m}{z}, t, x\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t} \cdot x\_m\\
\end{array}
\end{array}
if z < -7.99999999999999977e-28 or 1.6200000000000001e75 < z Initial program 75.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6462.0
Applied rewrites62.0%
Taylor expanded in z around inf
Applied rewrites62.6%
if -7.99999999999999977e-28 < z < 1.6200000000000001e75Initial program 93.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6491.7
Applied rewrites91.7%
Taylor expanded in z around 0
lower-/.f6466.7
Applied rewrites66.7%
Final simplification65.0%
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 (or (<= z -8e-28) (not (<= z 1.62e+75))) (/ x_m 1.0) (* (/ 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 <= -8e-28) || !(z <= 1.62e+75)) {
tmp = x_m / 1.0;
} else {
tmp = (y / t) * 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 <= (-8d-28)) .or. (.not. (z <= 1.62d+75))) then
tmp = x_m / 1.0d0
else
tmp = (y / t) * 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 <= -8e-28) || !(z <= 1.62e+75)) {
tmp = x_m / 1.0;
} else {
tmp = (y / t) * 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 <= -8e-28) or not (z <= 1.62e+75): tmp = x_m / 1.0 else: tmp = (y / t) * 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 <= -8e-28) || !(z <= 1.62e+75)) tmp = Float64(x_m / 1.0); else tmp = Float64(Float64(y / t) * 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 <= -8e-28) || ~((z <= 1.62e+75))) tmp = x_m / 1.0; else tmp = (y / t) * 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[Or[LessEqual[z, -8e-28], N[Not[LessEqual[z, 1.62e+75]], $MachinePrecision]], N[(x$95$m / 1.0), $MachinePrecision], N[(N[(y / t), $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 -8 \cdot 10^{-28} \lor \neg \left(z \leq 1.62 \cdot 10^{+75}\right):\\
\;\;\;\;\frac{x\_m}{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t} \cdot x\_m\\
\end{array}
\end{array}
if z < -7.99999999999999977e-28 or 1.6200000000000001e75 < z Initial program 75.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in z around inf
Applied rewrites62.4%
if -7.99999999999999977e-28 < z < 1.6200000000000001e75Initial program 93.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6491.7
Applied rewrites91.7%
Taylor expanded in z around 0
lower-/.f6466.7
Applied rewrites66.7%
Final simplification64.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 (or (<= z -4e-31) (not (<= z 1.6e+75))) (/ x_m 1.0) (* (/ x_m t) y))))
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 <= -4e-31) || !(z <= 1.6e+75)) {
tmp = x_m / 1.0;
} else {
tmp = (x_m / t) * y;
}
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 <= (-4d-31)) .or. (.not. (z <= 1.6d+75))) then
tmp = x_m / 1.0d0
else
tmp = (x_m / t) * y
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -4e-31) || !(z <= 1.6e+75)) {
tmp = x_m / 1.0;
} else {
tmp = (x_m / t) * y;
}
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 <= -4e-31) or not (z <= 1.6e+75): tmp = x_m / 1.0 else: tmp = (x_m / t) * y 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 <= -4e-31) || !(z <= 1.6e+75)) tmp = Float64(x_m / 1.0); else tmp = Float64(Float64(x_m / t) * y); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if ((z <= -4e-31) || ~((z <= 1.6e+75))) tmp = x_m / 1.0; else tmp = (x_m / t) * y; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -4e-31], N[Not[LessEqual[z, 1.6e+75]], $MachinePrecision]], N[(x$95$m / 1.0), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] * y), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-31} \lor \neg \left(z \leq 1.6 \cdot 10^{+75}\right):\\
\;\;\;\;\frac{x\_m}{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{t} \cdot y\\
\end{array}
\end{array}
if z < -4e-31 or 1.59999999999999992e75 < z Initial program 75.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in z around inf
Applied rewrites61.8%
if -4e-31 < z < 1.59999999999999992e75Initial program 93.5%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6464.7
Applied rewrites64.7%
Applied rewrites65.9%
Final simplification64.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 (if (<= x_m 2e+17) (/ (* 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 <= 2e+17) {
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 <= 2d+17) 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 <= 2e+17) {
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 <= 2e+17: 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 <= 2e+17) 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 <= 2e+17) 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, 2e+17], 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 2 \cdot 10^{+17}:\\
\;\;\;\;\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 < 2e17Initial program 90.5%
if 2e17 < x Initial program 70.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6498.0
Applied rewrites98.0%
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 (* (/ (- y z) (- 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) {
return x_s * (((y - z) / (t - z)) * 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 * (((y - z) / (t - z)) * 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 * (((y - z) / (t - z)) * 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 * (((y - z) / (t - z)) * 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 * Float64(Float64(Float64(y - z) / Float64(t - z)) * 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 * (((y - z) / (t - z)) * x_m); end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $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 \left(\frac{y - z}{t - z} \cdot x\_m\right)
\end{array}
Initial program 86.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6494.9
Applied rewrites94.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 (/ x_m 1.0)))
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 / 1.0);
}
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 / 1.0d0)
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 / 1.0);
}
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 / 1.0)
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 / 1.0)) 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 / 1.0); 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 / 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \frac{x\_m}{1}
\end{array}
Initial program 86.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6495.5
Applied rewrites95.5%
Taylor expanded in z around inf
Applied rewrites30.7%
(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 2024318
(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)))