
(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 (<= (/ (* (- y z) x_m) (- t z)) -5e-214)
(* (- z y) (/ x_m (- z t)))
(* (/ (- 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 ((((y - z) * x_m) / (t - z)) <= -5e-214) {
tmp = (z - y) * (x_m / (z - t));
} 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 ((((y - z) * x_m) / (t - z)) <= (-5d-214)) then
tmp = (z - y) * (x_m / (z - t))
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 ((((y - z) * x_m) / (t - z)) <= -5e-214) {
tmp = (z - y) * (x_m / (z - t));
} 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 (((y - z) * x_m) / (t - z)) <= -5e-214: tmp = (z - y) * (x_m / (z - t)) 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 (Float64(Float64(Float64(y - z) * x_m) / Float64(t - z)) <= -5e-214) tmp = Float64(Float64(z - y) * Float64(x_m / Float64(z - t))); else tmp = Float64(Float64(Float64(z - y) / 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 ((((y - z) * x_m) / (t - z)) <= -5e-214) tmp = (z - y) * (x_m / (z - t)); 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[N[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], -5e-214], N[(N[(z - y), $MachinePrecision] * N[(x$95$m / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z - y), $MachinePrecision] / 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}\;\frac{\left(y - z\right) \cdot x\_m}{t - z} \leq -5 \cdot 10^{-214}:\\
\;\;\;\;\left(z - y\right) \cdot \frac{x\_m}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{z - y}{z - t} \cdot x\_m\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -4.9999999999999998e-214Initial program 74.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6485.2
Applied rewrites85.2%
if -4.9999999999999998e-214 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 86.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6494.1
Applied rewrites94.1%
Final simplification90.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 z))))
(*
x_s
(if (<= t_1 -2e-54)
(* (/ x_m (- t z)) y)
(if (<= t_1 4e-185) (/ (* z x_m) (- z t)) (- x_m (/ (* y x_m) 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 t_1 = ((y - z) * x_m) / (t - z);
double tmp;
if (t_1 <= -2e-54) {
tmp = (x_m / (t - z)) * y;
} else if (t_1 <= 4e-185) {
tmp = (z * x_m) / (z - t);
} else {
tmp = x_m - ((y * x_m) / 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) :: t_1
real(8) :: tmp
t_1 = ((y - z) * x_m) / (t - z)
if (t_1 <= (-2d-54)) then
tmp = (x_m / (t - z)) * y
else if (t_1 <= 4d-185) then
tmp = (z * x_m) / (z - t)
else
tmp = x_m - ((y * x_m) / 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 t_1 = ((y - z) * x_m) / (t - z);
double tmp;
if (t_1 <= -2e-54) {
tmp = (x_m / (t - z)) * y;
} else if (t_1 <= 4e-185) {
tmp = (z * x_m) / (z - t);
} else {
tmp = x_m - ((y * x_m) / 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): t_1 = ((y - z) * x_m) / (t - z) tmp = 0 if t_1 <= -2e-54: tmp = (x_m / (t - z)) * y elif t_1 <= 4e-185: tmp = (z * x_m) / (z - t) else: tmp = x_m - ((y * x_m) / z) 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) / Float64(t - z)) tmp = 0.0 if (t_1 <= -2e-54) tmp = Float64(Float64(x_m / Float64(t - z)) * y); elseif (t_1 <= 4e-185) tmp = Float64(Float64(z * x_m) / Float64(z - t)); else tmp = Float64(x_m - Float64(Float64(y * x_m) / 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) t_1 = ((y - z) * x_m) / (t - z); tmp = 0.0; if (t_1 <= -2e-54) tmp = (x_m / (t - z)) * y; elseif (t_1 <= 4e-185) tmp = (z * x_m) / (z - t); else tmp = x_m - ((y * x_m) / 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_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, -2e-54], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 4e-185], N[(N[(z * x$95$m), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(x$95$m - N[(N[(y * x$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]), $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 - z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-54}:\\
\;\;\;\;\frac{x\_m}{t - z} \cdot y\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-185}:\\
\;\;\;\;\frac{z \cdot x\_m}{z - t}\\
\mathbf{else}:\\
\;\;\;\;x\_m - \frac{y \cdot x\_m}{z}\\
\end{array}
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -2.0000000000000001e-54Initial program 65.5%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6450.5
Applied rewrites50.5%
if -2.0000000000000001e-54 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 4e-185Initial program 94.9%
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-lft-outN/A
associate-/l*N/A
*-commutativeN/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-*.f6443.7
Applied rewrites43.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--.f6469.5
Applied rewrites69.5%
if 4e-185 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 81.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-lft-outN/A
associate-/l*N/A
*-commutativeN/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-*.f6460.0
Applied rewrites60.0%
Final simplification60.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 z))))
(*
x_s
(if (<= t_1 -5e-214)
(* (/ x_m (- t z)) y)
(if (<= t_1 2e-298) (/ (* y x_m) t) (- x_m (/ (* y x_m) 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 t_1 = ((y - z) * x_m) / (t - z);
double tmp;
if (t_1 <= -5e-214) {
tmp = (x_m / (t - z)) * y;
} else if (t_1 <= 2e-298) {
tmp = (y * x_m) / t;
} else {
tmp = x_m - ((y * x_m) / 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) :: t_1
real(8) :: tmp
t_1 = ((y - z) * x_m) / (t - z)
if (t_1 <= (-5d-214)) then
tmp = (x_m / (t - z)) * y
else if (t_1 <= 2d-298) then
tmp = (y * x_m) / t
else
tmp = x_m - ((y * x_m) / 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 t_1 = ((y - z) * x_m) / (t - z);
double tmp;
if (t_1 <= -5e-214) {
tmp = (x_m / (t - z)) * y;
} else if (t_1 <= 2e-298) {
tmp = (y * x_m) / t;
} else {
tmp = x_m - ((y * x_m) / 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): t_1 = ((y - z) * x_m) / (t - z) tmp = 0 if t_1 <= -5e-214: tmp = (x_m / (t - z)) * y elif t_1 <= 2e-298: tmp = (y * x_m) / t else: tmp = x_m - ((y * x_m) / z) 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) / Float64(t - z)) tmp = 0.0 if (t_1 <= -5e-214) tmp = Float64(Float64(x_m / Float64(t - z)) * y); elseif (t_1 <= 2e-298) tmp = Float64(Float64(y * x_m) / t); else tmp = Float64(x_m - Float64(Float64(y * x_m) / 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) t_1 = ((y - z) * x_m) / (t - z); tmp = 0.0; if (t_1 <= -5e-214) tmp = (x_m / (t - z)) * y; elseif (t_1 <= 2e-298) tmp = (y * x_m) / t; else tmp = x_m - ((y * x_m) / 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_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, -5e-214], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 2e-298], N[(N[(y * x$95$m), $MachinePrecision] / t), $MachinePrecision], N[(x$95$m - N[(N[(y * x$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]), $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 - z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-214}:\\
\;\;\;\;\frac{x\_m}{t - z} \cdot y\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-298}:\\
\;\;\;\;\frac{y \cdot x\_m}{t}\\
\mathbf{else}:\\
\;\;\;\;x\_m - \frac{y \cdot x\_m}{z}\\
\end{array}
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -4.9999999999999998e-214Initial program 74.1%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6443.3
Applied rewrites43.3%
if -4.9999999999999998e-214 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 1.99999999999999982e-298Initial program 90.2%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6468.9
Applied rewrites68.9%
if 1.99999999999999982e-298 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 84.9%
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-lft-outN/A
associate-/l*N/A
*-commutativeN/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-*.f6458.8
Applied rewrites58.8%
Final simplification54.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 (<= y -1.75e+90)
(* (/ y (- t z)) x_m)
(if (<= y -2.9e-48)
(fma x_m (/ (- t y) z) x_m)
(if (<= y -1.46e-137)
(/ (* (- y z) x_m) t)
(if (<= y 5.4e+98) (* (/ z (- z t)) x_m) (/ (* y x_m) (- 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 (y <= -1.75e+90) {
tmp = (y / (t - z)) * x_m;
} else if (y <= -2.9e-48) {
tmp = fma(x_m, ((t - y) / z), x_m);
} else if (y <= -1.46e-137) {
tmp = ((y - z) * x_m) / t;
} else if (y <= 5.4e+98) {
tmp = (z / (z - t)) * x_m;
} else {
tmp = (y * x_m) / (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 (y <= -1.75e+90) tmp = Float64(Float64(y / Float64(t - z)) * x_m); elseif (y <= -2.9e-48) tmp = fma(x_m, Float64(Float64(t - y) / z), x_m); elseif (y <= -1.46e-137) tmp = Float64(Float64(Float64(y - z) * x_m) / t); elseif (y <= 5.4e+98) tmp = Float64(Float64(z / Float64(z - t)) * x_m); else tmp = Float64(Float64(y * x_m) / Float64(t - 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[y, -1.75e+90], N[(N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], If[LessEqual[y, -2.9e-48], N[(x$95$m * N[(N[(t - y), $MachinePrecision] / z), $MachinePrecision] + x$95$m), $MachinePrecision], If[LessEqual[y, -1.46e-137], N[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 5.4e+98], N[(N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], N[(N[(y * x$95$m), $MachinePrecision] / N[(t - 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}\;y \leq -1.75 \cdot 10^{+90}:\\
\;\;\;\;\frac{y}{t - z} \cdot x\_m\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{-48}:\\
\;\;\;\;\mathsf{fma}\left(x\_m, \frac{t - y}{z}, x\_m\right)\\
\mathbf{elif}\;y \leq -1.46 \cdot 10^{-137}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot x\_m}{t}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+98}:\\
\;\;\;\;\frac{z}{z - t} \cdot x\_m\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x\_m}{t - z}\\
\end{array}
\end{array}
if y < -1.7499999999999999e90Initial program 85.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6497.7
Applied rewrites97.7%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6489.5
Applied rewrites89.5%
if -1.7499999999999999e90 < y < -2.9000000000000003e-48Initial program 86.1%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/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
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6477.6
Applied rewrites77.6%
if -2.9000000000000003e-48 < y < -1.46e-137Initial program 90.8%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6476.8
Applied rewrites76.8%
if -1.46e-137 < y < 5.4e98Initial program 74.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6496.2
Applied rewrites96.2%
Taylor expanded in z around inf
Applied rewrites55.6%
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--.f6485.9
Applied rewrites85.9%
if 5.4e98 < y Initial program 92.5%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f6478.4
Applied rewrites78.4%
Final simplification83.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 (<= y -1.15e+90)
(* (/ y (- t z)) x_m)
(if (<= y -4.8e-64)
(fma (/ (- x_m) z) y x_m)
(if (<= y -1.46e-137)
(/ (* (- y z) x_m) t)
(if (<= y 5.4e+98) (* (/ z (- z t)) x_m) (/ (* y x_m) (- 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 (y <= -1.15e+90) {
tmp = (y / (t - z)) * x_m;
} else if (y <= -4.8e-64) {
tmp = fma((-x_m / z), y, x_m);
} else if (y <= -1.46e-137) {
tmp = ((y - z) * x_m) / t;
} else if (y <= 5.4e+98) {
tmp = (z / (z - t)) * x_m;
} else {
tmp = (y * x_m) / (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 (y <= -1.15e+90) tmp = Float64(Float64(y / Float64(t - z)) * x_m); elseif (y <= -4.8e-64) tmp = fma(Float64(Float64(-x_m) / z), y, x_m); elseif (y <= -1.46e-137) tmp = Float64(Float64(Float64(y - z) * x_m) / t); elseif (y <= 5.4e+98) tmp = Float64(Float64(z / Float64(z - t)) * x_m); else tmp = Float64(Float64(y * x_m) / Float64(t - 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[y, -1.15e+90], N[(N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], If[LessEqual[y, -4.8e-64], N[(N[((-x$95$m) / z), $MachinePrecision] * y + x$95$m), $MachinePrecision], If[LessEqual[y, -1.46e-137], N[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 5.4e+98], N[(N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], N[(N[(y * x$95$m), $MachinePrecision] / N[(t - 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}\;y \leq -1.15 \cdot 10^{+90}:\\
\;\;\;\;\frac{y}{t - z} \cdot x\_m\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{-64}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-x\_m}{z}, y, x\_m\right)\\
\mathbf{elif}\;y \leq -1.46 \cdot 10^{-137}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot x\_m}{t}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+98}:\\
\;\;\;\;\frac{z}{z - t} \cdot x\_m\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x\_m}{t - z}\\
\end{array}
\end{array}
if y < -1.15e90Initial program 85.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6497.7
Applied rewrites97.7%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6489.5
Applied rewrites89.5%
if -1.15e90 < y < -4.79999999999999997e-64Initial program 87.0%
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-lft-outN/A
associate-/l*N/A
*-commutativeN/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-*.f6471.6
Applied rewrites71.6%
Applied rewrites75.0%
if -4.79999999999999997e-64 < y < -1.46e-137Initial program 89.9%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.5
Applied rewrites79.5%
if -1.46e-137 < y < 5.4e98Initial program 74.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6496.2
Applied rewrites96.2%
Taylor expanded in z around inf
Applied rewrites55.6%
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--.f6485.9
Applied rewrites85.9%
if 5.4e98 < y Initial program 92.5%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f6478.4
Applied rewrites78.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
(let* ((t_1 (* (/ y (- t z)) x_m)))
(*
x_s
(if (<= y -1.15e+90)
t_1
(if (<= y -4.8e-64)
(fma (/ (- x_m) z) y x_m)
(if (<= y -1.46e-137)
(/ (* (- y z) x_m) t)
(if (<= y 5.4e+98) (* (/ 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 = (y / (t - z)) * x_m;
double tmp;
if (y <= -1.15e+90) {
tmp = t_1;
} else if (y <= -4.8e-64) {
tmp = fma((-x_m / z), y, x_m);
} else if (y <= -1.46e-137) {
tmp = ((y - z) * x_m) / t;
} else if (y <= 5.4e+98) {
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(y / Float64(t - z)) * x_m) tmp = 0.0 if (y <= -1.15e+90) tmp = t_1; elseif (y <= -4.8e-64) tmp = fma(Float64(Float64(-x_m) / z), y, x_m); elseif (y <= -1.46e-137) tmp = Float64(Float64(Float64(y - z) * x_m) / t); elseif (y <= 5.4e+98) tmp = Float64(Float64(z / Float64(z - t)) * 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[(y / N[(t - z), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -1.15e+90], t$95$1, If[LessEqual[y, -4.8e-64], N[(N[((-x$95$m) / z), $MachinePrecision] * y + x$95$m), $MachinePrecision], If[LessEqual[y, -1.46e-137], N[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 5.4e+98], 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{y}{t - z} \cdot x\_m\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{-64}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-x\_m}{z}, y, x\_m\right)\\
\mathbf{elif}\;y \leq -1.46 \cdot 10^{-137}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot x\_m}{t}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+98}:\\
\;\;\;\;\frac{z}{z - t} \cdot x\_m\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if y < -1.15e90 or 5.4e98 < y Initial program 88.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6494.2
Applied rewrites94.2%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6483.4
Applied rewrites83.4%
if -1.15e90 < y < -4.79999999999999997e-64Initial program 87.0%
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-lft-outN/A
associate-/l*N/A
*-commutativeN/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-*.f6471.6
Applied rewrites71.6%
Applied rewrites75.0%
if -4.79999999999999997e-64 < y < -1.46e-137Initial program 89.9%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.5
Applied rewrites79.5%
if -1.46e-137 < y < 5.4e98Initial program 74.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6496.2
Applied rewrites96.2%
Taylor expanded in z around inf
Applied rewrites55.6%
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--.f6485.9
Applied rewrites85.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.4e+184)
(- x_m (/ (* y x_m) z))
(if (<= z 8.6e+132)
(* (- z y) (/ x_m (- z t)))
(fma x_m (/ (- t y) 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.4e+184) {
tmp = x_m - ((y * x_m) / z);
} else if (z <= 8.6e+132) {
tmp = (z - y) * (x_m / (z - t));
} else {
tmp = fma(x_m, ((t - y) / 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.4e+184) tmp = Float64(x_m - Float64(Float64(y * x_m) / z)); elseif (z <= 8.6e+132) tmp = Float64(Float64(z - y) * Float64(x_m / Float64(z - t))); else tmp = fma(x_m, Float64(Float64(t - y) / 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.4e+184], N[(x$95$m - N[(N[(y * x$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.6e+132], N[(N[(z - y), $MachinePrecision] * N[(x$95$m / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(N[(t - y), $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 -1.4 \cdot 10^{+184}:\\
\;\;\;\;x\_m - \frac{y \cdot x\_m}{z}\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{+132}:\\
\;\;\;\;\left(z - y\right) \cdot \frac{x\_m}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x\_m, \frac{t - y}{z}, x\_m\right)\\
\end{array}
\end{array}
if z < -1.39999999999999995e184Initial program 59.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-lft-outN/A
associate-/l*N/A
*-commutativeN/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-*.f6497.2
Applied rewrites97.2%
if -1.39999999999999995e184 < z < 8.59999999999999964e132Initial program 87.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6490.2
Applied rewrites90.2%
if 8.59999999999999964e132 < z Initial program 71.8%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/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
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6499.9
Applied rewrites99.9%
Final simplification92.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 (<= t -4.5e+18)
(* (/ x_m t) (- y z))
(if (<= t 1.7e+57) (- x_m (/ (* y x_m) z)) (/ (* (- y z) x_m) t)))))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 (t <= -4.5e+18) {
tmp = (x_m / t) * (y - z);
} else if (t <= 1.7e+57) {
tmp = x_m - ((y * x_m) / z);
} else {
tmp = ((y - z) * x_m) / t;
}
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 (t <= (-4.5d+18)) then
tmp = (x_m / t) * (y - z)
else if (t <= 1.7d+57) then
tmp = x_m - ((y * x_m) / z)
else
tmp = ((y - z) * x_m) / t
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 (t <= -4.5e+18) {
tmp = (x_m / t) * (y - z);
} else if (t <= 1.7e+57) {
tmp = x_m - ((y * x_m) / z);
} else {
tmp = ((y - z) * x_m) / t;
}
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 t <= -4.5e+18: tmp = (x_m / t) * (y - z) elif t <= 1.7e+57: tmp = x_m - ((y * x_m) / z) else: tmp = ((y - z) * x_m) / t 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 (t <= -4.5e+18) tmp = Float64(Float64(x_m / t) * Float64(y - z)); elseif (t <= 1.7e+57) tmp = Float64(x_m - Float64(Float64(y * x_m) / z)); else tmp = Float64(Float64(Float64(y - z) * x_m) / t); 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 (t <= -4.5e+18) tmp = (x_m / t) * (y - z); elseif (t <= 1.7e+57) tmp = x_m - ((y * x_m) / z); else tmp = ((y - z) * x_m) / t; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -4.5e+18], N[(N[(x$95$m / t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.7e+57], N[(x$95$m - N[(N[(y * x$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / t), $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}\;t \leq -4.5 \cdot 10^{+18}:\\
\;\;\;\;\frac{x\_m}{t} \cdot \left(y - z\right)\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+57}:\\
\;\;\;\;x\_m - \frac{y \cdot x\_m}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot x\_m}{t}\\
\end{array}
\end{array}
if t < -4.5e18Initial program 80.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6484.5
Applied rewrites84.5%
Taylor expanded in t around inf
lower-/.f6471.5
Applied rewrites71.5%
if -4.5e18 < t < 1.69999999999999996e57Initial program 80.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-lft-outN/A
associate-/l*N/A
*-commutativeN/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-*.f6480.2
Applied rewrites80.2%
if 1.69999999999999996e57 < t Initial program 85.9%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.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 (<= z -2.1e-35)
(fma (/ (- x_m) z) y x_m)
(if (<= z 3.5e+15) (/ (* (- y z) x_m) t) (- x_m (/ (* y x_m) 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 <= -2.1e-35) {
tmp = fma((-x_m / z), y, x_m);
} else if (z <= 3.5e+15) {
tmp = ((y - z) * x_m) / t;
} else {
tmp = x_m - ((y * x_m) / 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 <= -2.1e-35) tmp = fma(Float64(Float64(-x_m) / z), y, x_m); elseif (z <= 3.5e+15) tmp = Float64(Float64(Float64(y - z) * x_m) / t); else tmp = Float64(x_m - Float64(Float64(y * x_m) / 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[z, -2.1e-35], N[(N[((-x$95$m) / z), $MachinePrecision] * y + x$95$m), $MachinePrecision], If[LessEqual[z, 3.5e+15], N[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / t), $MachinePrecision], N[(x$95$m - N[(N[(y * x$95$m), $MachinePrecision] / 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}\;z \leq -2.1 \cdot 10^{-35}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-x\_m}{z}, y, x\_m\right)\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+15}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot x\_m}{t}\\
\mathbf{else}:\\
\;\;\;\;x\_m - \frac{y \cdot x\_m}{z}\\
\end{array}
\end{array}
if z < -2.1e-35Initial program 74.7%
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-lft-outN/A
associate-/l*N/A
*-commutativeN/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-*.f6470.3
Applied rewrites70.3%
Applied rewrites72.6%
if -2.1e-35 < z < 3.5e15Initial program 92.0%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6477.8
Applied rewrites77.8%
if 3.5e15 < z Initial program 74.2%
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-lft-outN/A
associate-/l*N/A
*-commutativeN/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-*.f6477.4
Applied rewrites77.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
(let* ((t_1 (/ (* (- y z) x_m) t)))
(*
x_s
(if (<= t -4.5e+18) t_1 (if (<= t 1.7e+57) (- 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 <= -4.5e+18) {
tmp = t_1;
} else if (t <= 1.7e+57) {
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 <= (-4.5d+18)) then
tmp = t_1
else if (t <= 1.7d+57) 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 <= -4.5e+18) {
tmp = t_1;
} else if (t <= 1.7e+57) {
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 <= -4.5e+18: tmp = t_1 elif t <= 1.7e+57: 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 <= -4.5e+18) tmp = t_1; elseif (t <= 1.7e+57) 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 <= -4.5e+18) tmp = t_1; elseif (t <= 1.7e+57) 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, -4.5e+18], t$95$1, If[LessEqual[t, 1.7e+57], 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 -4.5 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+57}:\\
\;\;\;\;x\_m - \frac{y \cdot x\_m}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -4.5e18 or 1.69999999999999996e57 < t Initial program 83.2%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6470.5
Applied rewrites70.5%
if -4.5e18 < t < 1.69999999999999996e57Initial program 80.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-lft-outN/A
associate-/l*N/A
*-commutativeN/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-*.f6480.2
Applied rewrites80.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 -4.6e+99)
(* 1.0 x_m)
(if (<= z 3e+16) (* (/ 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 <= -4.6e+99) {
tmp = 1.0 * x_m;
} else if (z <= 3e+16) {
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 <= (-4.6d+99)) then
tmp = 1.0d0 * x_m
else if (z <= 3d+16) 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 <= -4.6e+99) {
tmp = 1.0 * x_m;
} else if (z <= 3e+16) {
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 <= -4.6e+99: tmp = 1.0 * x_m elif z <= 3e+16: 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 <= -4.6e+99) tmp = Float64(1.0 * x_m); elseif (z <= 3e+16) 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 <= -4.6e+99) tmp = 1.0 * x_m; elseif (z <= 3e+16) 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, -4.6e+99], N[(1.0 * x$95$m), $MachinePrecision], If[LessEqual[z, 3e+16], 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 -4.6 \cdot 10^{+99}:\\
\;\;\;\;1 \cdot x\_m\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+16}:\\
\;\;\;\;\frac{x\_m}{t - z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\_m\\
\end{array}
\end{array}
if z < -4.60000000000000038e99 or 3e16 < z Initial program 70.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites70.8%
if -4.60000000000000038e99 < z < 3e16Initial program 90.7%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6464.8
Applied rewrites64.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 -2.5e+52)
(* 1.0 x_m)
(if (<= z 2.9e+16) (* (/ 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 <= -2.5e+52) {
tmp = 1.0 * x_m;
} else if (z <= 2.9e+16) {
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 <= (-2.5d+52)) then
tmp = 1.0d0 * x_m
else if (z <= 2.9d+16) 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 <= -2.5e+52) {
tmp = 1.0 * x_m;
} else if (z <= 2.9e+16) {
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 <= -2.5e+52: tmp = 1.0 * x_m elif z <= 2.9e+16: 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 <= -2.5e+52) tmp = Float64(1.0 * x_m); elseif (z <= 2.9e+16) 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 <= -2.5e+52) tmp = 1.0 * x_m; elseif (z <= 2.9e+16) 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, -2.5e+52], N[(1.0 * x$95$m), $MachinePrecision], If[LessEqual[z, 2.9e+16], 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 -2.5 \cdot 10^{+52}:\\
\;\;\;\;1 \cdot x\_m\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+16}:\\
\;\;\;\;\frac{y}{t} \cdot x\_m\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\_m\\
\end{array}
\end{array}
if z < -2.5e52 or 2.9e16 < z Initial program 71.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites67.3%
if -2.5e52 < z < 2.9e16Initial program 92.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6491.6
Applied rewrites91.6%
Taylor expanded in z around 0
lower-/.f6459.6
Applied rewrites59.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 (<= z -2.5e+52)
(* 1.0 x_m)
(if (<= z 2.7e+16) (/ (* y x_m) t) (* 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 <= -2.5e+52) {
tmp = 1.0 * x_m;
} else if (z <= 2.7e+16) {
tmp = (y * x_m) / t;
} 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 <= (-2.5d+52)) then
tmp = 1.0d0 * x_m
else if (z <= 2.7d+16) then
tmp = (y * x_m) / t
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 <= -2.5e+52) {
tmp = 1.0 * x_m;
} else if (z <= 2.7e+16) {
tmp = (y * x_m) / t;
} 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 <= -2.5e+52: tmp = 1.0 * x_m elif z <= 2.7e+16: tmp = (y * x_m) / t 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 <= -2.5e+52) tmp = Float64(1.0 * x_m); elseif (z <= 2.7e+16) tmp = Float64(Float64(y * x_m) / t); 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 <= -2.5e+52) tmp = 1.0 * x_m; elseif (z <= 2.7e+16) tmp = (y * x_m) / t; 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, -2.5e+52], N[(1.0 * x$95$m), $MachinePrecision], If[LessEqual[z, 2.7e+16], N[(N[(y * x$95$m), $MachinePrecision] / t), $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.5 \cdot 10^{+52}:\\
\;\;\;\;1 \cdot x\_m\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+16}:\\
\;\;\;\;\frac{y \cdot x\_m}{t}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\_m\\
\end{array}
\end{array}
if z < -2.5e52 or 2.7e16 < z Initial program 71.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites67.3%
if -2.5e52 < z < 2.7e16Initial program 92.0%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6457.6
Applied rewrites57.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 (<= z -5.8e+50)
(* 1.0 x_m)
(if (<= z 2.7e+16) (* (/ 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 <= -5.8e+50) {
tmp = 1.0 * x_m;
} else if (z <= 2.7e+16) {
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 <= (-5.8d+50)) then
tmp = 1.0d0 * x_m
else if (z <= 2.7d+16) 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 <= -5.8e+50) {
tmp = 1.0 * x_m;
} else if (z <= 2.7e+16) {
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 <= -5.8e+50: tmp = 1.0 * x_m elif z <= 2.7e+16: 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 <= -5.8e+50) tmp = Float64(1.0 * x_m); elseif (z <= 2.7e+16) 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 <= -5.8e+50) tmp = 1.0 * x_m; elseif (z <= 2.7e+16) 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, -5.8e+50], N[(1.0 * x$95$m), $MachinePrecision], If[LessEqual[z, 2.7e+16], 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 -5.8 \cdot 10^{+50}:\\
\;\;\;\;1 \cdot x\_m\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+16}:\\
\;\;\;\;\frac{x\_m}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\_m\\
\end{array}
\end{array}
if z < -5.8e50 or 2.7e16 < z Initial program 71.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites67.3%
if -5.8e50 < z < 2.7e16Initial program 92.0%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6457.6
Applied rewrites57.6%
Applied rewrites55.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 (* 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 81.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6495.6
Applied rewrites95.6%
Taylor expanded in z around inf
Applied rewrites39.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 2024267
(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)))