
(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 13 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 1.8e+27)
(/ (* (- y z) x_m) (- t z))
(/ (- z y) (/ (- z 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 (x_m <= 1.8e+27) {
tmp = ((y - z) * x_m) / (t - z);
} else {
tmp = (z - y) / ((z - 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 (x_m <= 1.8d+27) then
tmp = ((y - z) * x_m) / (t - z)
else
tmp = (z - y) / ((z - 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 (x_m <= 1.8e+27) {
tmp = ((y - z) * x_m) / (t - z);
} else {
tmp = (z - y) / ((z - 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 x_m <= 1.8e+27: tmp = ((y - z) * x_m) / (t - z) else: tmp = (z - y) / ((z - 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 (x_m <= 1.8e+27) tmp = Float64(Float64(Float64(y - z) * x_m) / Float64(t - z)); else tmp = Float64(Float64(z - y) / Float64(Float64(z - 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 (x_m <= 1.8e+27) tmp = ((y - z) * x_m) / (t - z); else tmp = (z - y) / ((z - 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[LessEqual[x$95$m, 1.8e+27], N[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(z - y), $MachinePrecision] / N[(N[(z - t), $MachinePrecision] / x$95$m), $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 1.8 \cdot 10^{+27}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot x\_m}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{z - y}{\frac{z - t}{x\_m}}\\
\end{array}
\end{array}
if x < 1.79999999999999991e27Initial program 91.9%
if 1.79999999999999991e27 < x Initial program 68.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6494.6
Applied rewrites94.6%
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
associate-/r/N/A
un-div-invN/A
frac-2negN/A
lift--.f64N/A
sub-negN/A
lift-neg.f64N/A
+-commutativeN/A
distribute-neg-inN/A
lift-neg.f64N/A
remove-double-negN/A
sub-negN/A
lower-/.f64N/A
lower--.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
Applied rewrites96.0%
Final simplification92.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 (<= y -1.02e+121)
(* (/ y (- t z)) x_m)
(if (<= y -1.26)
(fma (/ (- y) z) x_m x_m)
(if (<= y 3.1e+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 (y <= -1.02e+121) {
tmp = (y / (t - z)) * x_m;
} else if (y <= -1.26) {
tmp = fma((-y / z), x_m, x_m);
} else if (y <= 3.1e+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 (y <= -1.02e+121) tmp = Float64(Float64(y / Float64(t - z)) * x_m); elseif (y <= -1.26) tmp = fma(Float64(Float64(-y) / z), x_m, x_m); elseif (y <= 3.1e+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 = 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[y, -1.02e+121], N[(N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], If[LessEqual[y, -1.26], N[(N[((-y) / z), $MachinePrecision] * x$95$m + x$95$m), $MachinePrecision], If[LessEqual[y, 3.1e+28], 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}\;y \leq -1.02 \cdot 10^{+121}:\\
\;\;\;\;\frac{y}{t - z} \cdot x\_m\\
\mathbf{elif}\;y \leq -1.26:\\
\;\;\;\;\mathsf{fma}\left(\frac{-y}{z}, x\_m, x\_m\right)\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+28}:\\
\;\;\;\;\frac{z}{z - t} \cdot x\_m\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{t - z} \cdot y\\
\end{array}
\end{array}
if y < -1.02000000000000005e121Initial program 85.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6497.1
Applied rewrites97.1%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6494.7
Applied rewrites94.7%
if -1.02000000000000005e121 < y < -1.26000000000000001Initial program 85.7%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6460.5
Applied rewrites60.5%
Taylor expanded in z around inf
+-commutativeN/A
associate-/l*N/A
+-commutativeN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
distribute-neg-outN/A
distribute-neg-fracN/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites70.9%
Taylor expanded in y around inf
Applied rewrites70.9%
if -1.26000000000000001 < y < 3.1000000000000001e28Initial program 87.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6495.7
Applied rewrites95.7%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negN/A
lift-neg.f64N/A
+-commutativeN/A
distribute-neg-inN/A
lift-neg.f64N/A
remove-double-negN/A
sub-negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
lift-neg.f64N/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
lift-neg.f64N/A
remove-double-negN/A
lower--.f64N/A
lower--.f6494.7
Applied rewrites94.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6479.3
Applied rewrites79.3%
if 3.1000000000000001e28 < y Initial program 88.4%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6482.8
Applied rewrites82.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 -1.85e+111)
(* 1.0 x_m)
(if (<= z -1.45e-57)
(* (/ (- x_m) z) y)
(if (<= z 125.0) (* (/ x_m t) y) (* 1.0 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.85e+111) {
tmp = 1.0 * x_m;
} else if (z <= -1.45e-57) {
tmp = (-x_m / z) * y;
} else if (z <= 125.0) {
tmp = (x_m / t) * y;
} else {
tmp = 1.0 * 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.85d+111)) then
tmp = 1.0d0 * x_m
else if (z <= (-1.45d-57)) then
tmp = (-x_m / z) * y
else if (z <= 125.0d0) then
tmp = (x_m / t) * y
else
tmp = 1.0d0 * 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.85e+111) {
tmp = 1.0 * x_m;
} else if (z <= -1.45e-57) {
tmp = (-x_m / z) * y;
} else if (z <= 125.0) {
tmp = (x_m / t) * y;
} else {
tmp = 1.0 * 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.85e+111: tmp = 1.0 * x_m elif z <= -1.45e-57: tmp = (-x_m / z) * y elif z <= 125.0: tmp = (x_m / t) * y else: tmp = 1.0 * 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.85e+111) tmp = Float64(1.0 * x_m); elseif (z <= -1.45e-57) tmp = Float64(Float64(Float64(-x_m) / z) * y); elseif (z <= 125.0) tmp = Float64(Float64(x_m / t) * y); else tmp = Float64(1.0 * 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.85e+111) tmp = 1.0 * x_m; elseif (z <= -1.45e-57) tmp = (-x_m / z) * y; elseif (z <= 125.0) tmp = (x_m / t) * y; else tmp = 1.0 * 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.85e+111], N[(1.0 * x$95$m), $MachinePrecision], If[LessEqual[z, -1.45e-57], N[(N[((-x$95$m) / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 125.0], N[(N[(x$95$m / t), $MachinePrecision] * y), $MachinePrecision], N[(1.0 * 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.85 \cdot 10^{+111}:\\
\;\;\;\;1 \cdot x\_m\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-57}:\\
\;\;\;\;\frac{-x\_m}{z} \cdot y\\
\mathbf{elif}\;z \leq 125:\\
\;\;\;\;\frac{x\_m}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\_m\\
\end{array}
\end{array}
if z < -1.8500000000000001e111 or 125 < z Initial program 76.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
Applied rewrites64.7%
if -1.8500000000000001e111 < z < -1.45000000000000013e-57Initial program 95.0%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6461.3
Applied rewrites61.3%
Taylor expanded in z around inf
Applied rewrites47.8%
if -1.45000000000000013e-57 < z < 125Initial program 93.3%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6457.1
Applied rewrites57.1%
Applied rewrites58.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.8e+98)
(fma (/ (- y) z) x_m x_m)
(if (<= z 2.1e+182) (* (/ x_m (- t z)) (- y z)) (* (/ z (- z 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 <= -3.8e+98) {
tmp = fma((-y / z), x_m, x_m);
} else if (z <= 2.1e+182) {
tmp = (x_m / (t - z)) * (y - z);
} else {
tmp = (z / (z - 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 <= -3.8e+98) tmp = fma(Float64(Float64(-y) / z), x_m, x_m); elseif (z <= 2.1e+182) tmp = Float64(Float64(x_m / Float64(t - z)) * Float64(y - z)); else tmp = Float64(Float64(z / Float64(z - 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[LessEqual[z, -3.8e+98], N[(N[((-y) / z), $MachinePrecision] * x$95$m + x$95$m), $MachinePrecision], If[LessEqual[z, 2.1e+182], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision], N[(N[(z / N[(z - t), $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 \begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-y}{z}, x\_m, x\_m\right)\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+182}:\\
\;\;\;\;\frac{x\_m}{t - z} \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{z - t} \cdot x\_m\\
\end{array}
\end{array}
if z < -3.7999999999999999e98Initial program 69.5%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6416.0
Applied rewrites16.0%
Taylor expanded in z around inf
+-commutativeN/A
associate-/l*N/A
+-commutativeN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
distribute-neg-outN/A
distribute-neg-fracN/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites95.2%
Taylor expanded in y around inf
Applied rewrites95.2%
if -3.7999999999999999e98 < z < 2.0999999999999999e182Initial program 93.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6494.1
Applied rewrites94.1%
if 2.0999999999999999e182 < z Initial program 63.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negN/A
lift-neg.f64N/A
+-commutativeN/A
distribute-neg-inN/A
lift-neg.f64N/A
remove-double-negN/A
sub-negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
lift-neg.f64N/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
lift-neg.f64N/A
remove-double-negN/A
lower--.f64N/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6495.6
Applied rewrites95.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 (- t z)) y)))
(*
x_s
(if (<= y -7.8e+36) t_1 (if (<= y 3.1e+28) (* (/ z (- z t)) 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 / (t - z)) * y;
double tmp;
if (y <= -7.8e+36) {
tmp = t_1;
} else if (y <= 3.1e+28) {
tmp = (z / (z - t)) * x_m;
} 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 / (t - z)) * y
if (y <= (-7.8d+36)) then
tmp = t_1
else if (y <= 3.1d+28) then
tmp = (z / (z - t)) * x_m
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;
double tmp;
if (y <= -7.8e+36) {
tmp = t_1;
} else if (y <= 3.1e+28) {
tmp = (z / (z - t)) * x_m;
} 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 tmp = 0 if y <= -7.8e+36: tmp = t_1 elif y <= 3.1e+28: tmp = (z / (z - t)) * 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(Float64(x_m / Float64(t - z)) * y) tmp = 0.0 if (y <= -7.8e+36) tmp = t_1; elseif (y <= 3.1e+28) tmp = Float64(Float64(z / Float64(z - t)) * x_m); 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; tmp = 0.0; if (y <= -7.8e+36) tmp = t_1; elseif (y <= 3.1e+28) tmp = (z / (z - t)) * x_m; 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] * y), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -7.8e+36], t$95$1, If[LessEqual[y, 3.1e+28], N[(N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision] * 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 := \frac{x\_m}{t - z} \cdot y\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+28}:\\
\;\;\;\;\frac{z}{z - t} \cdot x\_m\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if y < -7.80000000000000042e36 or 3.1000000000000001e28 < y Initial program 87.6%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6479.0
Applied rewrites79.0%
if -7.80000000000000042e36 < y < 3.1000000000000001e28Initial program 86.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6496.0
Applied rewrites96.0%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negN/A
lift-neg.f64N/A
+-commutativeN/A
distribute-neg-inN/A
lift-neg.f64N/A
remove-double-negN/A
sub-negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
lift-neg.f64N/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
lift-neg.f64N/A
remove-double-negN/A
lower--.f64N/A
lower--.f6495.0
Applied rewrites95.0%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6477.8
Applied rewrites77.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
(let* ((t_1 (/ (* (- y z) x_m) t)))
(*
x_s
(if (<= t -3050000000000.0)
t_1
(if (<= t 3.5e+94) (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 = ((y - z) * x_m) / t;
double tmp;
if (t <= -3050000000000.0) {
tmp = t_1;
} else if (t <= 3.5e+94) {
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(Float64(Float64(y - z) * x_m) / t) tmp = 0.0 if (t <= -3050000000000.0) tmp = t_1; elseif (t <= 3.5e+94) tmp = fma(Float64(Float64(-y) / 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[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / t), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -3050000000000.0], t$95$1, If[LessEqual[t, 3.5e+94], 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 := \frac{\left(y - z\right) \cdot x\_m}{t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3050000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-y}{z}, x\_m, x\_m\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -3.05e12 or 3.4999999999999997e94 < t Initial program 86.3%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6474.7
Applied rewrites74.7%
if -3.05e12 < t < 3.4999999999999997e94Initial program 87.8%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6448.5
Applied rewrites48.5%
Taylor expanded in z around inf
+-commutativeN/A
associate-/l*N/A
+-commutativeN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
distribute-neg-outN/A
distribute-neg-fracN/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites78.6%
Taylor expanded in y around inf
Applied rewrites78.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 (/ (* (- y z) x_m) t)))
(*
x_s
(if (<= t -2900000000000.0)
t_1
(if (<= t 3.5e+94) (- 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 = ((y - z) * x_m) / t;
double tmp;
if (t <= -2900000000000.0) {
tmp = t_1;
} else if (t <= 3.5e+94) {
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 = ((y - z) * x_m) / t
if (t <= (-2900000000000.0d0)) then
tmp = t_1
else if (t <= 3.5d+94) 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 = ((y - z) * x_m) / t;
double tmp;
if (t <= -2900000000000.0) {
tmp = t_1;
} else if (t <= 3.5e+94) {
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 = ((y - z) * x_m) / t tmp = 0 if t <= -2900000000000.0: tmp = t_1 elif t <= 3.5e+94: 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(Float64(Float64(y - z) * x_m) / t) tmp = 0.0 if (t <= -2900000000000.0) tmp = t_1; elseif (t <= 3.5e+94) tmp = Float64(x_m - Float64(Float64(y * 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 = ((y - z) * x_m) / t; tmp = 0.0; if (t <= -2900000000000.0) tmp = t_1; elseif (t <= 3.5e+94) 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[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / t), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -2900000000000.0], t$95$1, If[LessEqual[t, 3.5e+94], N[(x$95$m - N[(N[(y * x$95$m), $MachinePrecision] / z), $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{\left(y - z\right) \cdot x\_m}{t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2900000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+94}:\\
\;\;\;\;x\_m - \frac{y \cdot x\_m}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -2.9e12 or 3.4999999999999997e94 < t Initial program 86.3%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6474.7
Applied rewrites74.7%
if -2.9e12 < t < 3.4999999999999997e94Initial program 87.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
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.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 (- x_m (/ (* y x_m) z))))
(*
x_s
(if (<= z -550000000.0)
t_1
(if (<= z 7.5e-40) (* (/ 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 = x_m - ((y * x_m) / z);
double tmp;
if (z <= -550000000.0) {
tmp = t_1;
} else if (z <= 7.5e-40) {
tmp = (x_m / (t - z)) * y;
} 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 * x_m) / z)
if (z <= (-550000000.0d0)) then
tmp = t_1
else if (z <= 7.5d-40) then
tmp = (x_m / (t - z)) * y
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m - ((y * x_m) / z);
double tmp;
if (z <= -550000000.0) {
tmp = t_1;
} else if (z <= 7.5e-40) {
tmp = (x_m / (t - z)) * y;
} 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 * x_m) / z) tmp = 0 if z <= -550000000.0: tmp = t_1 elif z <= 7.5e-40: 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 = Float64(x_m - Float64(Float64(y * x_m) / z)) tmp = 0.0 if (z <= -550000000.0) tmp = t_1; elseif (z <= 7.5e-40) tmp = Float64(Float64(x_m / Float64(t - z)) * y); 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 * x_m) / z); tmp = 0.0; if (z <= -550000000.0) tmp = t_1; elseif (z <= 7.5e-40) tmp = (x_m / (t - z)) * y; else tmp = t_1; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m - N[(N[(y * x$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -550000000.0], t$95$1, If[LessEqual[z, 7.5e-40], 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 := x\_m - \frac{y \cdot x\_m}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -550000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-40}:\\
\;\;\;\;\frac{x\_m}{t - z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -5.5e8 or 7.50000000000000069e-40 < z Initial program 81.4%
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
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6472.5
Applied rewrites72.5%
if -5.5e8 < z < 7.50000000000000069e-40Initial program 93.5%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6473.2
Applied rewrites73.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 -2e+111)
(* 1.0 x_m)
(if (<= z 1.2e+123) (* (/ x_m (- t z)) y) (* 1.0 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+111) {
tmp = 1.0 * x_m;
} else if (z <= 1.2e+123) {
tmp = (x_m / (t - z)) * y;
} else {
tmp = 1.0 * 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 <= (-2d+111)) then
tmp = 1.0d0 * x_m
else if (z <= 1.2d+123) then
tmp = (x_m / (t - z)) * y
else
tmp = 1.0d0 * 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 <= -2e+111) {
tmp = 1.0 * x_m;
} else if (z <= 1.2e+123) {
tmp = (x_m / (t - z)) * y;
} else {
tmp = 1.0 * 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 <= -2e+111: tmp = 1.0 * x_m elif z <= 1.2e+123: tmp = (x_m / (t - z)) * y else: tmp = 1.0 * 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+111) tmp = Float64(1.0 * x_m); elseif (z <= 1.2e+123) tmp = Float64(Float64(x_m / Float64(t - z)) * y); else tmp = Float64(1.0 * 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 <= -2e+111) tmp = 1.0 * x_m; elseif (z <= 1.2e+123) tmp = (x_m / (t - z)) * y; else tmp = 1.0 * 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, -2e+111], N[(1.0 * x$95$m), $MachinePrecision], If[LessEqual[z, 1.2e+123], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(1.0 * 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^{+111}:\\
\;\;\;\;1 \cdot x\_m\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+123}:\\
\;\;\;\;\frac{x\_m}{t - z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\_m\\
\end{array}
\end{array}
if z < -1.99999999999999991e111 or 1.19999999999999994e123 < z Initial program 72.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
Applied rewrites74.0%
if -1.99999999999999991e111 < z < 1.19999999999999994e123Initial program 93.0%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6467.5
Applied rewrites67.5%
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 -1500.0)
(* 1.0 x_m)
(if (<= z 235.0) (* (/ y t) x_m) (* 1.0 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 <= -1500.0) {
tmp = 1.0 * x_m;
} else if (z <= 235.0) {
tmp = (y / t) * x_m;
} else {
tmp = 1.0 * 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 <= (-1500.0d0)) then
tmp = 1.0d0 * x_m
else if (z <= 235.0d0) then
tmp = (y / t) * x_m
else
tmp = 1.0d0 * 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 <= -1500.0) {
tmp = 1.0 * x_m;
} else if (z <= 235.0) {
tmp = (y / t) * x_m;
} else {
tmp = 1.0 * 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 <= -1500.0: tmp = 1.0 * x_m elif z <= 235.0: tmp = (y / t) * x_m else: tmp = 1.0 * 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 <= -1500.0) tmp = Float64(1.0 * x_m); elseif (z <= 235.0) tmp = Float64(Float64(y / t) * x_m); else tmp = Float64(1.0 * 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 <= -1500.0) tmp = 1.0 * x_m; elseif (z <= 235.0) tmp = (y / t) * x_m; else tmp = 1.0 * 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, -1500.0], N[(1.0 * x$95$m), $MachinePrecision], If[LessEqual[z, 235.0], N[(N[(y / t), $MachinePrecision] * x$95$m), $MachinePrecision], N[(1.0 * 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 -1500:\\
\;\;\;\;1 \cdot x\_m\\
\mathbf{elif}\;z \leq 235:\\
\;\;\;\;\frac{y}{t} \cdot x\_m\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\_m\\
\end{array}
\end{array}
if z < -1500 or 235 < z Initial program 79.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
Applied rewrites57.0%
if -1500 < z < 235Initial program 94.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6492.3
Applied rewrites92.3%
Taylor expanded in z around 0
lower-/.f6456.7
Applied rewrites56.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 -1500.0)
(* 1.0 x_m)
(if (<= z 125.0) (* (/ x_m t) y) (* 1.0 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 <= -1500.0) {
tmp = 1.0 * x_m;
} else if (z <= 125.0) {
tmp = (x_m / t) * y;
} else {
tmp = 1.0 * 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 <= (-1500.0d0)) then
tmp = 1.0d0 * x_m
else if (z <= 125.0d0) then
tmp = (x_m / t) * y
else
tmp = 1.0d0 * 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 <= -1500.0) {
tmp = 1.0 * x_m;
} else if (z <= 125.0) {
tmp = (x_m / t) * y;
} else {
tmp = 1.0 * 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 <= -1500.0: tmp = 1.0 * x_m elif z <= 125.0: tmp = (x_m / t) * y else: tmp = 1.0 * 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 <= -1500.0) tmp = Float64(1.0 * x_m); elseif (z <= 125.0) tmp = Float64(Float64(x_m / t) * y); else tmp = Float64(1.0 * 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 <= -1500.0) tmp = 1.0 * x_m; elseif (z <= 125.0) tmp = (x_m / t) * y; else tmp = 1.0 * 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, -1500.0], N[(1.0 * x$95$m), $MachinePrecision], If[LessEqual[z, 125.0], N[(N[(x$95$m / t), $MachinePrecision] * y), $MachinePrecision], N[(1.0 * 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 -1500:\\
\;\;\;\;1 \cdot x\_m\\
\mathbf{elif}\;z \leq 125:\\
\;\;\;\;\frac{x\_m}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\_m\\
\end{array}
\end{array}
if z < -1500 or 125 < z Initial program 79.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
Applied rewrites57.0%
if -1500 < z < 125Initial program 94.0%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6455.8
Applied rewrites55.8%
Applied rewrites56.5%
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 87.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6495.9
Applied rewrites95.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 (* 1.0 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 * (1.0 * 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 * (1.0d0 * 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 * (1.0 * 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 * (1.0 * 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(1.0 * 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 * (1.0 * 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[(1.0 * 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(1 \cdot x\_m\right)
\end{array}
Initial program 87.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6495.9
Applied rewrites95.9%
Taylor expanded in z around inf
Applied rewrites34.5%
(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 2024294
(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)))