
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(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 5.1e-11)
(/ (* x_m (- y z)) (- 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 <= 5.1e-11) {
tmp = (x_m * (y - z)) / (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 <= 5.1d-11) then
tmp = (x_m * (y - z)) / (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 <= 5.1e-11) {
tmp = (x_m * (y - z)) / (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 <= 5.1e-11: tmp = (x_m * (y - z)) / (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 <= 5.1e-11) tmp = Float64(Float64(x_m * Float64(y - z)) / 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 <= 5.1e-11) tmp = (x_m * (y - z)) / (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, 5.1e-11], N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $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 5.1 \cdot 10^{-11}:\\
\;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{z - y}{\frac{z - t}{x\_m}}\\
\end{array}
\end{array}
if x < 5.09999999999999984e-11Initial program 88.8%
if 5.09999999999999984e-11 < x Initial program 73.0%
associate-/l*95.5%
Simplified95.5%
Taylor expanded in x around 0 73.0%
remove-double-neg73.0%
distribute-neg-frac273.0%
*-commutative73.0%
associate-/l*98.3%
distribute-lft-neg-out98.3%
neg-sub098.3%
associate--r-98.3%
neg-sub098.3%
+-commutative98.3%
sub-neg98.3%
neg-sub098.3%
associate--r-98.3%
neg-sub098.3%
+-commutative98.3%
sub-neg98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in x around 0 73.0%
*-commutative73.0%
*-rgt-identity73.0%
times-frac95.5%
/-rgt-identity95.5%
associate-/r/98.4%
Simplified98.4%
Final simplification91.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
(let* ((t_1 (* x_m (- 1.0 (/ y z)))))
(*
x_s
(if (<= z -1.56e+178)
t_1
(if (<= z -2.9e+71)
(* z (/ x_m (- z t)))
(if (<= z -4.2e-56)
(* x_m (/ y (- t z)))
(if (<= z 1.45e+40) (/ (* x_m (- y z)) t) t_1)))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m * (1.0 - (y / z));
double tmp;
if (z <= -1.56e+178) {
tmp = t_1;
} else if (z <= -2.9e+71) {
tmp = z * (x_m / (z - t));
} else if (z <= -4.2e-56) {
tmp = x_m * (y / (t - z));
} else if (z <= 1.45e+40) {
tmp = (x_m * (y - z)) / t;
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x_m * (1.0d0 - (y / z))
if (z <= (-1.56d+178)) then
tmp = t_1
else if (z <= (-2.9d+71)) then
tmp = z * (x_m / (z - t))
else if (z <= (-4.2d-56)) then
tmp = x_m * (y / (t - z))
else if (z <= 1.45d+40) then
tmp = (x_m * (y - z)) / t
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m * (1.0 - (y / z));
double tmp;
if (z <= -1.56e+178) {
tmp = t_1;
} else if (z <= -2.9e+71) {
tmp = z * (x_m / (z - t));
} else if (z <= -4.2e-56) {
tmp = x_m * (y / (t - z));
} else if (z <= 1.45e+40) {
tmp = (x_m * (y - z)) / t;
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = x_m * (1.0 - (y / z)) tmp = 0 if z <= -1.56e+178: tmp = t_1 elif z <= -2.9e+71: tmp = z * (x_m / (z - t)) elif z <= -4.2e-56: tmp = x_m * (y / (t - z)) elif z <= 1.45e+40: tmp = (x_m * (y - z)) / t else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -1.56e+178) tmp = t_1; elseif (z <= -2.9e+71) tmp = Float64(z * Float64(x_m / Float64(z - t))); elseif (z <= -4.2e-56) tmp = Float64(x_m * Float64(y / Float64(t - z))); elseif (z <= 1.45e+40) tmp = Float64(Float64(x_m * Float64(y - z)) / t); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = x_m * (1.0 - (y / z)); tmp = 0.0; if (z <= -1.56e+178) tmp = t_1; elseif (z <= -2.9e+71) tmp = z * (x_m / (z - t)); elseif (z <= -4.2e-56) tmp = x_m * (y / (t - z)); elseif (z <= 1.45e+40) tmp = (x_m * (y - z)) / t; else tmp = t_1; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.56e+178], t$95$1, If[LessEqual[z, -2.9e+71], N[(z * N[(x$95$m / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.2e-56], N[(x$95$m * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+40], N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := x\_m \cdot \left(1 - \frac{y}{z}\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.56 \cdot 10^{+178}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{+71}:\\
\;\;\;\;z \cdot \frac{x\_m}{z - t}\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-56}:\\
\;\;\;\;x\_m \cdot \frac{y}{t - z}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+40}:\\
\;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -1.56e178 or 1.45000000000000009e40 < z Initial program 66.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 56.1%
mul-1-neg56.1%
associate-/l*86.1%
distribute-rgt-neg-in86.1%
distribute-frac-neg86.1%
neg-sub086.1%
associate--r-86.1%
neg-sub086.1%
+-commutative86.1%
sub-neg86.1%
div-sub86.1%
*-inverses86.1%
Simplified86.1%
if -1.56e178 < z < -2.90000000000000007e71Initial program 74.7%
remove-double-neg74.7%
distribute-lft-neg-out74.7%
distribute-neg-frac74.7%
distribute-neg-frac274.7%
distribute-lft-neg-out74.7%
distribute-rgt-neg-in74.7%
sub-neg74.7%
distribute-neg-in74.7%
remove-double-neg74.7%
+-commutative74.7%
sub-neg74.7%
sub-neg74.7%
distribute-neg-in74.7%
remove-double-neg74.7%
+-commutative74.7%
sub-neg74.7%
Simplified74.7%
Taylor expanded in y around 0 66.0%
*-commutative66.0%
associate-/l*78.4%
Applied egg-rr78.4%
if -2.90000000000000007e71 < z < -4.20000000000000012e-56Initial program 91.2%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in y around inf 65.7%
associate-/l*74.2%
Simplified74.2%
if -4.20000000000000012e-56 < z < 1.45000000000000009e40Initial program 97.3%
associate-/l*91.9%
Simplified91.9%
Taylor expanded in t around inf 79.6%
Final simplification81.2%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -7.2e-56) (not (<= z 3.45e-15)))
(* x_m (- 1.0 (/ y z)))
(/ (* x_m y) 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 ((z <= -7.2e-56) || !(z <= 3.45e-15)) {
tmp = x_m * (1.0 - (y / z));
} else {
tmp = (x_m * y) / 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 ((z <= (-7.2d-56)) .or. (.not. (z <= 3.45d-15))) then
tmp = x_m * (1.0d0 - (y / z))
else
tmp = (x_m * y) / t
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -7.2e-56) || !(z <= 3.45e-15)) {
tmp = x_m * (1.0 - (y / z));
} else {
tmp = (x_m * y) / 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 (z <= -7.2e-56) or not (z <= 3.45e-15): tmp = x_m * (1.0 - (y / z)) else: tmp = (x_m * y) / 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 ((z <= -7.2e-56) || !(z <= 3.45e-15)) tmp = Float64(x_m * Float64(1.0 - Float64(y / z))); else tmp = Float64(Float64(x_m * y) / 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 ((z <= -7.2e-56) || ~((z <= 3.45e-15))) tmp = x_m * (1.0 - (y / z)); else tmp = (x_m * y) / t; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -7.2e-56], N[Not[LessEqual[z, 3.45e-15]], $MachinePrecision]], N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m * y), $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}\;z \leq -7.2 \cdot 10^{-56} \lor \neg \left(z \leq 3.45 \cdot 10^{-15}\right):\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m \cdot y}{t}\\
\end{array}
\end{array}
if z < -7.19999999999999956e-56 or 3.45000000000000005e-15 < z Initial program 73.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 51.8%
mul-1-neg51.8%
associate-/l*72.3%
distribute-rgt-neg-in72.3%
distribute-frac-neg72.3%
neg-sub072.3%
associate--r-72.3%
neg-sub072.3%
+-commutative72.3%
sub-neg72.3%
div-sub72.3%
*-inverses72.3%
Simplified72.3%
if -7.19999999999999956e-56 < z < 3.45000000000000005e-15Initial program 97.1%
associate-/l*91.3%
Simplified91.3%
Taylor expanded in z around 0 70.5%
Final simplification71.4%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -3.5e+71) (not (<= z 1.95e-12)))
(* x_m (- 1.0 (/ y z)))
(* x_m (/ y (- t z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -3.5e+71) || !(z <= 1.95e-12)) {
tmp = x_m * (1.0 - (y / z));
} else {
tmp = x_m * (y / (t - z));
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3.5d+71)) .or. (.not. (z <= 1.95d-12))) then
tmp = x_m * (1.0d0 - (y / z))
else
tmp = x_m * (y / (t - z))
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -3.5e+71) || !(z <= 1.95e-12)) {
tmp = x_m * (1.0 - (y / z));
} else {
tmp = x_m * (y / (t - z));
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -3.5e+71) or not (z <= 1.95e-12): tmp = x_m * (1.0 - (y / z)) else: tmp = x_m * (y / (t - z)) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -3.5e+71) || !(z <= 1.95e-12)) tmp = Float64(x_m * Float64(1.0 - Float64(y / z))); else tmp = Float64(x_m * Float64(y / Float64(t - z))); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if ((z <= -3.5e+71) || ~((z <= 1.95e-12))) tmp = x_m * (1.0 - (y / z)); else tmp = x_m * (y / (t - z)); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -3.5e+71], N[Not[LessEqual[z, 1.95e-12]], $MachinePrecision]], N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+71} \lor \neg \left(z \leq 1.95 \cdot 10^{-12}\right):\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -3.4999999999999999e71 or 1.94999999999999997e-12 < z Initial program 70.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 52.2%
mul-1-neg52.2%
associate-/l*75.7%
distribute-rgt-neg-in75.7%
distribute-frac-neg75.7%
neg-sub075.7%
associate--r-75.7%
neg-sub075.7%
+-commutative75.7%
sub-neg75.7%
div-sub75.7%
*-inverses75.7%
Simplified75.7%
if -3.4999999999999999e71 < z < 1.94999999999999997e-12Initial program 96.2%
associate-/l*92.6%
Simplified92.6%
Taylor expanded in y around inf 78.5%
associate-/l*76.6%
Simplified76.6%
Final simplification76.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 (or (<= t -3.1e-35) (not (<= t 980000000000.0)))
(* x_m (/ (- y z) t))
(* x_m (- 1.0 (/ y z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((t <= -3.1e-35) || !(t <= 980000000000.0)) {
tmp = x_m * ((y - z) / t);
} else {
tmp = x_m * (1.0 - (y / z));
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-3.1d-35)) .or. (.not. (t <= 980000000000.0d0))) then
tmp = x_m * ((y - z) / t)
else
tmp = x_m * (1.0d0 - (y / z))
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((t <= -3.1e-35) || !(t <= 980000000000.0)) {
tmp = x_m * ((y - z) / t);
} else {
tmp = x_m * (1.0 - (y / z));
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if (t <= -3.1e-35) or not (t <= 980000000000.0): tmp = x_m * ((y - z) / t) else: tmp = x_m * (1.0 - (y / z)) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((t <= -3.1e-35) || !(t <= 980000000000.0)) tmp = Float64(x_m * Float64(Float64(y - z) / t)); else tmp = Float64(x_m * Float64(1.0 - Float64(y / z))); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if ((t <= -3.1e-35) || ~((t <= 980000000000.0))) tmp = x_m * ((y - z) / t); else tmp = x_m * (1.0 - (y / z)); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[t, -3.1e-35], N[Not[LessEqual[t, 980000000000.0]], $MachinePrecision]], N[(x$95$m * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{-35} \lor \neg \left(t \leq 980000000000\right):\\
\;\;\;\;x\_m \cdot \frac{y - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\
\end{array}
\end{array}
if t < -3.10000000000000012e-35 or 9.8e11 < t Initial program 83.3%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in t around inf 71.0%
associate-/l*74.6%
Simplified74.6%
if -3.10000000000000012e-35 < t < 9.8e11Initial program 86.4%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in t around 0 69.2%
mul-1-neg69.2%
associate-/l*78.7%
distribute-rgt-neg-in78.7%
distribute-frac-neg78.7%
neg-sub078.7%
associate--r-78.7%
neg-sub078.7%
+-commutative78.7%
sub-neg78.7%
div-sub78.7%
*-inverses78.7%
Simplified78.7%
Final simplification76.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 (<= t -6.8e-31)
(* x_m (/ (- y z) t))
(if (<= t 4000000000000.0)
(* x_m (- 1.0 (/ y z)))
(/ x_m (/ t (- y z)))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -6.8e-31) {
tmp = x_m * ((y - z) / t);
} else if (t <= 4000000000000.0) {
tmp = x_m * (1.0 - (y / z));
} else {
tmp = x_m / (t / (y - z));
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-6.8d-31)) then
tmp = x_m * ((y - z) / t)
else if (t <= 4000000000000.0d0) then
tmp = x_m * (1.0d0 - (y / z))
else
tmp = x_m / (t / (y - z))
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -6.8e-31) {
tmp = x_m * ((y - z) / t);
} else if (t <= 4000000000000.0) {
tmp = x_m * (1.0 - (y / z));
} else {
tmp = x_m / (t / (y - z));
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if t <= -6.8e-31: tmp = x_m * ((y - z) / t) elif t <= 4000000000000.0: tmp = x_m * (1.0 - (y / z)) else: tmp = x_m / (t / (y - z)) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= -6.8e-31) tmp = Float64(x_m * Float64(Float64(y - z) / t)); elseif (t <= 4000000000000.0) tmp = Float64(x_m * Float64(1.0 - Float64(y / z))); else tmp = Float64(x_m / Float64(t / Float64(y - z))); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (t <= -6.8e-31) tmp = x_m * ((y - z) / t); elseif (t <= 4000000000000.0) tmp = x_m * (1.0 - (y / z)); else tmp = x_m / (t / (y - z)); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -6.8e-31], N[(x$95$m * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4000000000000.0], N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{-31}:\\
\;\;\;\;x\_m \cdot \frac{y - z}{t}\\
\mathbf{elif}\;t \leq 4000000000000:\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\frac{t}{y - z}}\\
\end{array}
\end{array}
if t < -6.8000000000000002e-31Initial program 81.4%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in t around inf 68.7%
associate-/l*72.9%
Simplified72.9%
if -6.8000000000000002e-31 < t < 4e12Initial program 86.4%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in t around 0 69.2%
mul-1-neg69.2%
associate-/l*78.7%
distribute-rgt-neg-in78.7%
distribute-frac-neg78.7%
neg-sub078.7%
associate--r-78.7%
neg-sub078.7%
+-commutative78.7%
sub-neg78.7%
div-sub78.7%
*-inverses78.7%
Simplified78.7%
if 4e12 < t Initial program 85.3%
associate-/l*96.8%
Simplified96.8%
clear-num96.8%
un-div-inv96.9%
Applied egg-rr96.9%
Taylor expanded in t around inf 76.5%
Final simplification76.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 -8e+67) x_m (if (<= z 1.22e-11) (* x_m (/ y t)) x_m))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -8e+67) {
tmp = x_m;
} else if (z <= 1.22e-11) {
tmp = x_m * (y / t);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-8d+67)) then
tmp = x_m
else if (z <= 1.22d-11) then
tmp = x_m * (y / t)
else
tmp = x_m
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -8e+67) {
tmp = x_m;
} else if (z <= 1.22e-11) {
tmp = x_m * (y / t);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if z <= -8e+67: tmp = x_m elif z <= 1.22e-11: tmp = x_m * (y / t) else: tmp = x_m return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -8e+67) tmp = x_m; elseif (z <= 1.22e-11) tmp = Float64(x_m * Float64(y / t)); else tmp = x_m; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (z <= -8e+67) tmp = x_m; elseif (z <= 1.22e-11) tmp = x_m * (y / t); else tmp = x_m; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -8e+67], x$95$m, If[LessEqual[z, 1.22e-11], N[(x$95$m * N[(y / t), $MachinePrecision]), $MachinePrecision], x$95$m]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+67}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;z \leq 1.22 \cdot 10^{-11}:\\
\;\;\;\;x\_m \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -7.99999999999999986e67 or 1.2200000000000001e-11 < z Initial program 70.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 64.7%
if -7.99999999999999986e67 < z < 1.2200000000000001e-11Initial program 96.2%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in z around 0 65.9%
associate-/l*64.7%
Simplified64.7%
Final simplification64.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 -2.8e+68) x_m (if (<= z 5.5e-13) (* y (/ x_m t)) x_m))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -2.8e+68) {
tmp = x_m;
} else if (z <= 5.5e-13) {
tmp = y * (x_m / t);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2.8d+68)) then
tmp = x_m
else if (z <= 5.5d-13) then
tmp = y * (x_m / t)
else
tmp = x_m
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -2.8e+68) {
tmp = x_m;
} else if (z <= 5.5e-13) {
tmp = y * (x_m / t);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if z <= -2.8e+68: tmp = x_m elif z <= 5.5e-13: tmp = y * (x_m / t) else: tmp = x_m return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -2.8e+68) tmp = x_m; elseif (z <= 5.5e-13) tmp = Float64(y * Float64(x_m / t)); else tmp = x_m; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (z <= -2.8e+68) tmp = x_m; elseif (z <= 5.5e-13) tmp = y * (x_m / t); else tmp = x_m; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -2.8e+68], x$95$m, If[LessEqual[z, 5.5e-13], N[(y * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision], x$95$m]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+68}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-13}:\\
\;\;\;\;y \cdot \frac{x\_m}{t}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -2.8e68 or 5.49999999999999979e-13 < z Initial program 70.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 64.7%
if -2.8e68 < z < 5.49999999999999979e-13Initial program 96.2%
associate-/l*92.5%
Simplified92.5%
clear-num92.3%
un-div-inv92.4%
Applied egg-rr92.4%
Taylor expanded in z around 0 64.5%
associate-/r/64.7%
Applied egg-rr64.7%
Final simplification64.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 -1.2e+69) x_m (if (<= z 6.5e-12) (/ (* x_m y) t) x_m))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -1.2e+69) {
tmp = x_m;
} else if (z <= 6.5e-12) {
tmp = (x_m * y) / t;
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.2d+69)) then
tmp = x_m
else if (z <= 6.5d-12) then
tmp = (x_m * y) / t
else
tmp = x_m
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -1.2e+69) {
tmp = x_m;
} else if (z <= 6.5e-12) {
tmp = (x_m * y) / t;
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if z <= -1.2e+69: tmp = x_m elif z <= 6.5e-12: tmp = (x_m * y) / t else: tmp = x_m return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -1.2e+69) tmp = x_m; elseif (z <= 6.5e-12) tmp = Float64(Float64(x_m * y) / t); else tmp = x_m; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (z <= -1.2e+69) tmp = x_m; elseif (z <= 6.5e-12) tmp = (x_m * y) / t; else tmp = x_m; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -1.2e+69], x$95$m, If[LessEqual[z, 6.5e-12], N[(N[(x$95$m * y), $MachinePrecision] / t), $MachinePrecision], x$95$m]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+69}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{x\_m \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -1.2000000000000001e69 or 6.5000000000000002e-12 < z Initial program 70.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 64.7%
if -1.2000000000000001e69 < z < 6.5000000000000002e-12Initial program 96.2%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in z around 0 65.9%
Final simplification65.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 (<= x_m 5000000000000.0)
(/ (* x_m (- y z)) (- t z))
(* (- z y) (/ x_m (- z 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 (x_m <= 5000000000000.0) {
tmp = (x_m * (y - z)) / (t - z);
} else {
tmp = (z - y) * (x_m / (z - 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 (x_m <= 5000000000000.0d0) then
tmp = (x_m * (y - z)) / (t - z)
else
tmp = (z - y) * (x_m / (z - 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 (x_m <= 5000000000000.0) {
tmp = (x_m * (y - z)) / (t - z);
} else {
tmp = (z - y) * (x_m / (z - 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 x_m <= 5000000000000.0: tmp = (x_m * (y - z)) / (t - z) else: tmp = (z - y) * (x_m / (z - 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 (x_m <= 5000000000000.0) tmp = Float64(Float64(x_m * Float64(y - z)) / Float64(t - z)); else tmp = Float64(Float64(z - y) * Float64(x_m / Float64(z - 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 (x_m <= 5000000000000.0) tmp = (x_m * (y - z)) / (t - z); else tmp = (z - y) * (x_m / (z - t)); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[x$95$m, 5000000000000.0], N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(z - y), $MachinePrecision] * N[(x$95$m / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 5000000000000:\\
\;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\left(z - y\right) \cdot \frac{x\_m}{z - t}\\
\end{array}
\end{array}
if x < 5e12Initial program 89.1%
if 5e12 < x Initial program 70.8%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in x around 0 70.8%
remove-double-neg70.8%
distribute-neg-frac270.8%
*-commutative70.8%
associate-/l*98.2%
distribute-lft-neg-out98.2%
neg-sub098.2%
associate--r-98.2%
neg-sub098.2%
+-commutative98.2%
sub-neg98.2%
neg-sub098.2%
associate--r-98.2%
neg-sub098.2%
+-commutative98.2%
sub-neg98.2%
*-commutative98.2%
Simplified98.2%
Final simplification91.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 (* x_m (/ (- y z) (- t z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m * ((y - z) / (t - z)));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x_s * (x_m * ((y - z) / (t - z)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m * ((y - z) / (t - z)));
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): return x_s * (x_m * ((y - z) / (t - z)))
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(x_m * Float64(Float64(y - z) / Float64(t - z)))) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z, t) tmp = x_s * (x_m * ((y - z) / (t - z))); end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \left(x\_m \cdot \frac{y - z}{t - z}\right)
\end{array}
Initial program 84.7%
associate-/l*95.8%
Simplified95.8%
Final simplification95.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 x_m))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * x_m;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x_s * x_m
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * x_m;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): return x_s * x_m
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) return Float64(x_s * x_m) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z, t) tmp = x_s * x_m; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * x$95$m), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot x\_m
\end{array}
Initial program 84.7%
associate-/l*95.8%
Simplified95.8%
Taylor expanded in z around inf 34.3%
Final simplification34.3%
(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 2024059
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:alt
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))