
(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 2e-6) (/ (* x_m (- y z)) (- t z)) (/ (- 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) {
double tmp;
if (x_m <= 2e-6) {
tmp = (x_m * (y - z)) / (t - z);
} else {
tmp = (y - z) / ((t - z) / 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 <= 2d-6) then
tmp = (x_m * (y - z)) / (t - z)
else
tmp = (y - z) / ((t - z) / 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 <= 2e-6) {
tmp = (x_m * (y - z)) / (t - z);
} else {
tmp = (y - z) / ((t - z) / 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 <= 2e-6: tmp = (x_m * (y - z)) / (t - z) else: tmp = (y - z) / ((t - z) / x_m) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (x_m <= 2e-6) tmp = Float64(Float64(x_m * Float64(y - z)) / Float64(t - z)); else tmp = Float64(Float64(y - z) / Float64(Float64(t - z) / 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 <= 2e-6) tmp = (x_m * (y - z)) / (t - z); else tmp = (y - z) / ((t - z) / 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, 2e-6], N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] / N[(N[(t - z), $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 2 \cdot 10^{-6}:\\
\;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - z}{\frac{t - z}{x\_m}}\\
\end{array}
\end{array}
if x < 1.99999999999999991e-6Initial program 86.9%
if 1.99999999999999991e-6 < x Initial program 70.0%
remove-double-neg70.0%
distribute-lft-neg-out70.0%
distribute-neg-frac70.0%
distribute-neg-frac270.0%
distribute-lft-neg-out70.0%
distribute-rgt-neg-in70.0%
sub-neg70.0%
distribute-neg-in70.0%
remove-double-neg70.0%
+-commutative70.0%
sub-neg70.0%
sub-neg70.0%
distribute-neg-in70.0%
remove-double-neg70.0%
+-commutative70.0%
sub-neg70.0%
Simplified70.0%
*-commutative70.0%
associate-/l*96.9%
Applied egg-rr96.9%
clear-num96.7%
un-div-inv97.1%
Applied egg-rr97.1%
Final simplification89.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 -7.4e+170)
(* x_m (- 1.0 (/ y z)))
(if (<= z -1.42e+26)
(/ x_m (/ (- z t) z))
(if (<= z 6.2e-129)
(* y (/ x_m (- t z)))
(if (<= z 4.8e+59) (* (- y z) (/ x_m t)) (* x_m (/ z (- 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 (z <= -7.4e+170) {
tmp = x_m * (1.0 - (y / z));
} else if (z <= -1.42e+26) {
tmp = x_m / ((z - t) / z);
} else if (z <= 6.2e-129) {
tmp = y * (x_m / (t - z));
} else if (z <= 4.8e+59) {
tmp = (y - z) * (x_m / t);
} else {
tmp = x_m * (z / (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 (z <= (-7.4d+170)) then
tmp = x_m * (1.0d0 - (y / z))
else if (z <= (-1.42d+26)) then
tmp = x_m / ((z - t) / z)
else if (z <= 6.2d-129) then
tmp = y * (x_m / (t - z))
else if (z <= 4.8d+59) then
tmp = (y - z) * (x_m / t)
else
tmp = x_m * (z / (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 (z <= -7.4e+170) {
tmp = x_m * (1.0 - (y / z));
} else if (z <= -1.42e+26) {
tmp = x_m / ((z - t) / z);
} else if (z <= 6.2e-129) {
tmp = y * (x_m / (t - z));
} else if (z <= 4.8e+59) {
tmp = (y - z) * (x_m / t);
} else {
tmp = x_m * (z / (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 z <= -7.4e+170: tmp = x_m * (1.0 - (y / z)) elif z <= -1.42e+26: tmp = x_m / ((z - t) / z) elif z <= 6.2e-129: tmp = y * (x_m / (t - z)) elif z <= 4.8e+59: tmp = (y - z) * (x_m / t) else: tmp = x_m * (z / (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 (z <= -7.4e+170) tmp = Float64(x_m * Float64(1.0 - Float64(y / z))); elseif (z <= -1.42e+26) tmp = Float64(x_m / Float64(Float64(z - t) / z)); elseif (z <= 6.2e-129) tmp = Float64(y * Float64(x_m / Float64(t - z))); elseif (z <= 4.8e+59) tmp = Float64(Float64(y - z) * Float64(x_m / t)); else tmp = Float64(x_m * Float64(z / 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 (z <= -7.4e+170) tmp = x_m * (1.0 - (y / z)); elseif (z <= -1.42e+26) tmp = x_m / ((z - t) / z); elseif (z <= 6.2e-129) tmp = y * (x_m / (t - z)); elseif (z <= 4.8e+59) tmp = (y - z) * (x_m / t); else tmp = x_m * (z / (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[z, -7.4e+170], N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.42e+26], N[(x$95$m / N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e-129], N[(y * N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e+59], N[(N[(y - z), $MachinePrecision] * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(z / 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}\;z \leq -7.4 \cdot 10^{+170}:\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq -1.42 \cdot 10^{+26}:\\
\;\;\;\;\frac{x\_m}{\frac{z - t}{z}}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-129}:\\
\;\;\;\;y \cdot \frac{x\_m}{t - z}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+59}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x\_m}{t}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -7.39999999999999975e170Initial program 62.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 50.9%
mul-1-neg50.9%
associate-/l*88.5%
distribute-rgt-neg-in88.5%
distribute-frac-neg88.5%
sub-neg88.5%
distribute-neg-in88.5%
remove-double-neg88.5%
+-commutative88.5%
sub-neg88.5%
div-sub88.5%
*-inverses88.5%
Simplified88.5%
if -7.39999999999999975e170 < z < -1.42e26Initial program 87.3%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around 0 87.3%
*-rgt-identity87.3%
times-frac87.0%
/-rgt-identity87.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 83.2%
neg-mul-183.2%
Simplified83.2%
if -1.42e26 < z < 6.2000000000000001e-129Initial program 90.8%
associate-/l*92.7%
Simplified92.7%
Taylor expanded in y around inf 81.2%
*-commutative81.2%
associate-/l*83.9%
Applied egg-rr83.9%
if 6.2000000000000001e-129 < z < 4.8000000000000004e59Initial program 96.8%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in t around inf 72.4%
associate-/l*72.3%
Applied egg-rr72.3%
*-commutative72.3%
associate-*l/72.4%
associate-*r/75.4%
*-commutative75.4%
Simplified75.4%
if 4.8000000000000004e59 < z Initial program 64.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 56.0%
mul-1-neg56.0%
distribute-neg-frac256.0%
sub-neg56.0%
distribute-neg-in56.0%
remove-double-neg56.0%
+-commutative56.0%
sub-neg56.0%
associate-/l*81.6%
Simplified81.6%
Final simplification82.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 (/ z (- z t)))))
(*
x_s
(if (<= z -5.2e+173)
(* x_m (- 1.0 (/ y z)))
(if (<= z -1.45e+26)
t_1
(if (<= z 3e-132)
(* y (/ x_m (- t z)))
(if (<= z 9.2e+52) (* (- y z) (/ x_m 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 * (z / (z - t));
double tmp;
if (z <= -5.2e+173) {
tmp = x_m * (1.0 - (y / z));
} else if (z <= -1.45e+26) {
tmp = t_1;
} else if (z <= 3e-132) {
tmp = y * (x_m / (t - z));
} else if (z <= 9.2e+52) {
tmp = (y - z) * (x_m / 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 * (z / (z - t))
if (z <= (-5.2d+173)) then
tmp = x_m * (1.0d0 - (y / z))
else if (z <= (-1.45d+26)) then
tmp = t_1
else if (z <= 3d-132) then
tmp = y * (x_m / (t - z))
else if (z <= 9.2d+52) then
tmp = (y - z) * (x_m / 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 * (z / (z - t));
double tmp;
if (z <= -5.2e+173) {
tmp = x_m * (1.0 - (y / z));
} else if (z <= -1.45e+26) {
tmp = t_1;
} else if (z <= 3e-132) {
tmp = y * (x_m / (t - z));
} else if (z <= 9.2e+52) {
tmp = (y - z) * (x_m / 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 * (z / (z - t)) tmp = 0 if z <= -5.2e+173: tmp = x_m * (1.0 - (y / z)) elif z <= -1.45e+26: tmp = t_1 elif z <= 3e-132: tmp = y * (x_m / (t - z)) elif z <= 9.2e+52: tmp = (y - z) * (x_m / 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(z / Float64(z - t))) tmp = 0.0 if (z <= -5.2e+173) tmp = Float64(x_m * Float64(1.0 - Float64(y / z))); elseif (z <= -1.45e+26) tmp = t_1; elseif (z <= 3e-132) tmp = Float64(y * Float64(x_m / Float64(t - z))); elseif (z <= 9.2e+52) tmp = Float64(Float64(y - z) * Float64(x_m / 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 * (z / (z - t)); tmp = 0.0; if (z <= -5.2e+173) tmp = x_m * (1.0 - (y / z)); elseif (z <= -1.45e+26) tmp = t_1; elseif (z <= 3e-132) tmp = y * (x_m / (t - z)); elseif (z <= 9.2e+52) tmp = (y - z) * (x_m / 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[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -5.2e+173], N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.45e+26], t$95$1, If[LessEqual[z, 3e-132], N[(y * N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e+52], N[(N[(y - z), $MachinePrecision] * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := x\_m \cdot \frac{z}{z - t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+173}:\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{+26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-132}:\\
\;\;\;\;y \cdot \frac{x\_m}{t - z}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+52}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x\_m}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -5.1999999999999997e173Initial program 62.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 50.9%
mul-1-neg50.9%
associate-/l*88.5%
distribute-rgt-neg-in88.5%
distribute-frac-neg88.5%
sub-neg88.5%
distribute-neg-in88.5%
remove-double-neg88.5%
+-commutative88.5%
sub-neg88.5%
div-sub88.5%
*-inverses88.5%
Simplified88.5%
if -5.1999999999999997e173 < z < -1.45e26 or 9.1999999999999999e52 < z Initial program 73.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 63.9%
mul-1-neg63.9%
distribute-neg-frac263.9%
sub-neg63.9%
distribute-neg-in63.9%
remove-double-neg63.9%
+-commutative63.9%
sub-neg63.9%
associate-/l*82.1%
Simplified82.1%
if -1.45e26 < z < 3e-132Initial program 90.8%
associate-/l*92.7%
Simplified92.7%
Taylor expanded in y around inf 81.2%
*-commutative81.2%
associate-/l*83.9%
Applied egg-rr83.9%
if 3e-132 < z < 9.1999999999999999e52Initial program 96.8%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in t around inf 72.4%
associate-/l*72.3%
Applied egg-rr72.3%
*-commutative72.3%
associate-*l/72.4%
associate-*r/75.4%
*-commutative75.4%
Simplified75.4%
Final simplification82.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 -2.25e+175)
(* x_m (- 1.0 (/ y z)))
(if (or (<= z -1.42e+26) (not (<= z 5.5e-104)))
(* x_m (/ z (- z t)))
(/ x_m (/ t y))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -2.25e+175) {
tmp = x_m * (1.0 - (y / z));
} else if ((z <= -1.42e+26) || !(z <= 5.5e-104)) {
tmp = x_m * (z / (z - t));
} else {
tmp = x_m / (t / y);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2.25d+175)) then
tmp = x_m * (1.0d0 - (y / z))
else if ((z <= (-1.42d+26)) .or. (.not. (z <= 5.5d-104))) then
tmp = x_m * (z / (z - t))
else
tmp = x_m / (t / y)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -2.25e+175) {
tmp = x_m * (1.0 - (y / z));
} else if ((z <= -1.42e+26) || !(z <= 5.5e-104)) {
tmp = x_m * (z / (z - t));
} else {
tmp = x_m / (t / y);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if z <= -2.25e+175: tmp = x_m * (1.0 - (y / z)) elif (z <= -1.42e+26) or not (z <= 5.5e-104): tmp = x_m * (z / (z - t)) else: tmp = x_m / (t / y) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -2.25e+175) tmp = Float64(x_m * Float64(1.0 - Float64(y / z))); elseif ((z <= -1.42e+26) || !(z <= 5.5e-104)) tmp = Float64(x_m * Float64(z / Float64(z - t))); else tmp = Float64(x_m / Float64(t / y)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (z <= -2.25e+175) tmp = x_m * (1.0 - (y / z)); elseif ((z <= -1.42e+26) || ~((z <= 5.5e-104))) tmp = x_m * (z / (z - t)); else tmp = x_m / (t / y); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -2.25e+175], N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.42e+26], N[Not[LessEqual[z, 5.5e-104]], $MachinePrecision]], N[(x$95$m * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(t / y), $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.25 \cdot 10^{+175}:\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq -1.42 \cdot 10^{+26} \lor \neg \left(z \leq 5.5 \cdot 10^{-104}\right):\\
\;\;\;\;x\_m \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -2.24999999999999995e175Initial program 62.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 50.9%
mul-1-neg50.9%
associate-/l*88.5%
distribute-rgt-neg-in88.5%
distribute-frac-neg88.5%
sub-neg88.5%
distribute-neg-in88.5%
remove-double-neg88.5%
+-commutative88.5%
sub-neg88.5%
div-sub88.5%
*-inverses88.5%
Simplified88.5%
if -2.24999999999999995e175 < z < -1.42e26 or 5.4999999999999998e-104 < z Initial program 79.8%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in y around 0 63.2%
mul-1-neg63.2%
distribute-neg-frac263.2%
sub-neg63.2%
distribute-neg-in63.2%
remove-double-neg63.2%
+-commutative63.2%
sub-neg63.2%
associate-/l*75.4%
Simplified75.4%
if -1.42e26 < z < 5.4999999999999998e-104Initial program 90.8%
associate-/l*92.7%
Simplified92.7%
Taylor expanded in x around 0 90.8%
*-rgt-identity90.8%
times-frac92.7%
/-rgt-identity92.7%
associate-/r/92.6%
Simplified92.6%
Taylor expanded in z around 0 73.6%
Final simplification76.3%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= t -2.4e+23) (not (<= t 9.5e-10)))
(* 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 <= -2.4e+23) || !(t <= 9.5e-10)) {
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 <= (-2.4d+23)) .or. (.not. (t <= 9.5d-10))) 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 <= -2.4e+23) || !(t <= 9.5e-10)) {
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 <= -2.4e+23) or not (t <= 9.5e-10): 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 <= -2.4e+23) || !(t <= 9.5e-10)) 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 <= -2.4e+23) || ~((t <= 9.5e-10))) 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, -2.4e+23], N[Not[LessEqual[t, 9.5e-10]], $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 -2.4 \cdot 10^{+23} \lor \neg \left(t \leq 9.5 \cdot 10^{-10}\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 < -2.4e23 or 9.50000000000000028e-10 < t Initial program 83.0%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in t around inf 72.1%
associate-/l*80.6%
Simplified80.6%
if -2.4e23 < t < 9.50000000000000028e-10Initial program 82.0%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in t around 0 64.1%
mul-1-neg64.1%
associate-/l*78.8%
distribute-rgt-neg-in78.8%
distribute-frac-neg78.8%
sub-neg78.8%
distribute-neg-in78.8%
remove-double-neg78.8%
+-commutative78.8%
sub-neg78.8%
div-sub78.8%
*-inverses78.8%
Simplified78.8%
Final simplification79.8%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -7e-40) (not (<= z 1e+53)))
(* x_m (- 1.0 (/ y z)))
(/ x_m (/ t y)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -7e-40) || !(z <= 1e+53)) {
tmp = x_m * (1.0 - (y / z));
} else {
tmp = x_m / (t / y);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-7d-40)) .or. (.not. (z <= 1d+53))) then
tmp = x_m * (1.0d0 - (y / z))
else
tmp = x_m / (t / y)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -7e-40) || !(z <= 1e+53)) {
tmp = x_m * (1.0 - (y / z));
} else {
tmp = x_m / (t / y);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -7e-40) or not (z <= 1e+53): tmp = x_m * (1.0 - (y / z)) else: tmp = x_m / (t / y) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -7e-40) || !(z <= 1e+53)) tmp = Float64(x_m * Float64(1.0 - Float64(y / z))); else tmp = Float64(x_m / Float64(t / y)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if ((z <= -7e-40) || ~((z <= 1e+53))) tmp = x_m * (1.0 - (y / z)); else tmp = x_m / (t / y); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -7e-40], N[Not[LessEqual[z, 1e+53]], $MachinePrecision]], N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(t / y), $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 -7 \cdot 10^{-40} \lor \neg \left(z \leq 10^{+53}\right):\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -7.0000000000000003e-40 or 9.9999999999999999e52 < z Initial program 71.6%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 52.4%
mul-1-neg52.4%
associate-/l*75.2%
distribute-rgt-neg-in75.2%
distribute-frac-neg75.2%
sub-neg75.2%
distribute-neg-in75.2%
remove-double-neg75.2%
+-commutative75.2%
sub-neg75.2%
div-sub75.2%
*-inverses75.2%
Simplified75.2%
if -7.0000000000000003e-40 < z < 9.9999999999999999e52Initial program 92.2%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in x around 0 92.2%
*-rgt-identity92.2%
times-frac93.1%
/-rgt-identity93.1%
associate-/r/92.9%
Simplified92.9%
Taylor expanded in z around 0 70.0%
Final simplification72.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 (<= t -8.5e+23)
(/ x_m (/ t (- y z)))
(if (<= t 4.6e-12) (* x_m (- 1.0 (/ y z))) (* x_m (/ (- y 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 (t <= -8.5e+23) {
tmp = x_m / (t / (y - z));
} else if (t <= 4.6e-12) {
tmp = x_m * (1.0 - (y / z));
} else {
tmp = x_m * ((y - 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 (t <= (-8.5d+23)) then
tmp = x_m / (t / (y - z))
else if (t <= 4.6d-12) then
tmp = x_m * (1.0d0 - (y / z))
else
tmp = x_m * ((y - 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 (t <= -8.5e+23) {
tmp = x_m / (t / (y - z));
} else if (t <= 4.6e-12) {
tmp = x_m * (1.0 - (y / z));
} else {
tmp = x_m * ((y - 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 t <= -8.5e+23: tmp = x_m / (t / (y - z)) elif t <= 4.6e-12: tmp = x_m * (1.0 - (y / z)) else: tmp = x_m * ((y - 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 (t <= -8.5e+23) tmp = Float64(x_m / Float64(t / Float64(y - z))); elseif (t <= 4.6e-12) tmp = Float64(x_m * Float64(1.0 - Float64(y / z))); else tmp = Float64(x_m * Float64(Float64(y - 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 (t <= -8.5e+23) tmp = x_m / (t / (y - z)); elseif (t <= 4.6e-12) tmp = x_m * (1.0 - (y / z)); else tmp = x_m * ((y - 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[t, -8.5e+23], N[(x$95$m / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e-12], N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(N[(y - z), $MachinePrecision] / t), $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 -8.5 \cdot 10^{+23}:\\
\;\;\;\;\frac{x\_m}{\frac{t}{y - z}}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-12}:\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{y - z}{t}\\
\end{array}
\end{array}
if t < -8.5000000000000001e23Initial program 79.5%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in x around 0 79.5%
*-rgt-identity79.5%
times-frac86.3%
/-rgt-identity86.3%
associate-/r/96.9%
Simplified96.9%
Taylor expanded in t around inf 84.9%
if -8.5000000000000001e23 < t < 4.59999999999999979e-12Initial program 82.0%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in t around 0 64.1%
mul-1-neg64.1%
associate-/l*78.8%
distribute-rgt-neg-in78.8%
distribute-frac-neg78.8%
sub-neg78.8%
distribute-neg-in78.8%
remove-double-neg78.8%
+-commutative78.8%
sub-neg78.8%
div-sub78.8%
*-inverses78.8%
Simplified78.8%
if 4.59999999999999979e-12 < t Initial program 86.3%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in t around inf 73.5%
associate-/l*76.7%
Simplified76.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.7e+65) x_m (if (<= z 3e+48) (/ x_m (/ t y)) 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.7e+65) {
tmp = x_m;
} else if (z <= 3e+48) {
tmp = x_m / (t / y);
} 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.7d+65)) then
tmp = x_m
else if (z <= 3d+48) then
tmp = x_m / (t / y)
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.7e+65) {
tmp = x_m;
} else if (z <= 3e+48) {
tmp = x_m / (t / y);
} 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.7e+65: tmp = x_m elif z <= 3e+48: tmp = x_m / (t / y) 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.7e+65) tmp = x_m; elseif (z <= 3e+48) tmp = Float64(x_m / Float64(t / y)); 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.7e+65) tmp = x_m; elseif (z <= 3e+48) tmp = x_m / (t / y); 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.7e+65], x$95$m, If[LessEqual[z, 3e+48], N[(x$95$m / N[(t / y), $MachinePrecision]), $MachinePrecision], x$95$m]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+65}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+48}:\\
\;\;\;\;\frac{x\_m}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -1.7e65 or 3e48 < z Initial program 70.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 63.3%
if -1.7e65 < z < 3e48Initial program 91.2%
associate-/l*93.7%
Simplified93.7%
Taylor expanded in x around 0 91.2%
*-rgt-identity91.2%
times-frac93.8%
/-rgt-identity93.8%
associate-/r/93.6%
Simplified93.6%
Taylor expanded in z around 0 67.4%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= z -4.4e+65) x_m (if (<= z 8.5e+60) (* 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 <= -4.4e+65) {
tmp = x_m;
} else if (z <= 8.5e+60) {
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 <= (-4.4d+65)) then
tmp = x_m
else if (z <= 8.5d+60) 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 <= -4.4e+65) {
tmp = x_m;
} else if (z <= 8.5e+60) {
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 <= -4.4e+65: tmp = x_m elif z <= 8.5e+60: 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 <= -4.4e+65) tmp = x_m; elseif (z <= 8.5e+60) 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 <= -4.4e+65) tmp = x_m; elseif (z <= 8.5e+60) 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, -4.4e+65], x$95$m, If[LessEqual[z, 8.5e+60], 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 -4.4 \cdot 10^{+65}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+60}:\\
\;\;\;\;x\_m \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -4.3999999999999997e65 or 8.50000000000000064e60 < z Initial program 69.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 63.5%
if -4.3999999999999997e65 < z < 8.50000000000000064e60Initial program 91.3%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in z around 0 61.9%
associate-/l*66.6%
Simplified66.6%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= x_m 2e+15) (/ (* x_m (- y z)) (- t z)) (* (- y z) (/ 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 (x_m <= 2e+15) {
tmp = (x_m * (y - z)) / (t - z);
} else {
tmp = (y - z) * (x_m / (t - z));
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x_m <= 2d+15) then
tmp = (x_m * (y - z)) / (t - z)
else
tmp = (y - z) * (x_m / (t - z))
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (x_m <= 2e+15) {
tmp = (x_m * (y - z)) / (t - z);
} else {
tmp = (y - z) * (x_m / (t - z));
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if x_m <= 2e+15: tmp = (x_m * (y - z)) / (t - z) else: tmp = (y - z) * (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 (x_m <= 2e+15) tmp = Float64(Float64(x_m * Float64(y - z)) / Float64(t - z)); else tmp = Float64(Float64(y - z) * Float64(x_m / Float64(t - z))); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (x_m <= 2e+15) tmp = (x_m * (y - z)) / (t - z); else tmp = (y - z) * (x_m / (t - z)); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[x$95$m, 2e+15], N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x$95$m / 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}\;x\_m \leq 2 \cdot 10^{+15}:\\
\;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x\_m}{t - z}\\
\end{array}
\end{array}
if x < 2e15Initial program 87.2%
if 2e15 < x Initial program 68.0%
remove-double-neg68.0%
distribute-lft-neg-out68.0%
distribute-neg-frac68.0%
distribute-neg-frac268.0%
distribute-lft-neg-out68.0%
distribute-rgt-neg-in68.0%
sub-neg68.0%
distribute-neg-in68.0%
remove-double-neg68.0%
+-commutative68.0%
sub-neg68.0%
sub-neg68.0%
distribute-neg-in68.0%
remove-double-neg68.0%
+-commutative68.0%
sub-neg68.0%
Simplified68.0%
*-commutative68.0%
associate-/l*96.8%
Applied egg-rr96.8%
Final simplification89.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 (<= x_m 8.4e-58)
(/ x_m (/ (- t z) (- y z)))
(* (- y z) (/ 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 (x_m <= 8.4e-58) {
tmp = x_m / ((t - z) / (y - z));
} else {
tmp = (y - z) * (x_m / (t - z));
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x_m <= 8.4d-58) then
tmp = x_m / ((t - z) / (y - z))
else
tmp = (y - z) * (x_m / (t - z))
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (x_m <= 8.4e-58) {
tmp = x_m / ((t - z) / (y - z));
} else {
tmp = (y - z) * (x_m / (t - z));
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if x_m <= 8.4e-58: tmp = x_m / ((t - z) / (y - z)) else: tmp = (y - z) * (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 (x_m <= 8.4e-58) tmp = Float64(x_m / Float64(Float64(t - z) / Float64(y - z))); else tmp = Float64(Float64(y - z) * Float64(x_m / Float64(t - z))); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (x_m <= 8.4e-58) tmp = x_m / ((t - z) / (y - z)); else tmp = (y - z) * (x_m / (t - z)); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[x$95$m, 8.4e-58], N[(x$95$m / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x$95$m / 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}\;x\_m \leq 8.4 \cdot 10^{-58}:\\
\;\;\;\;\frac{x\_m}{\frac{t - z}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x\_m}{t - z}\\
\end{array}
\end{array}
if x < 8.39999999999999951e-58Initial program 86.1%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in x around 0 86.1%
*-rgt-identity86.1%
times-frac82.7%
/-rgt-identity82.7%
associate-/r/96.6%
Simplified96.6%
if 8.39999999999999951e-58 < x Initial program 74.5%
remove-double-neg74.5%
distribute-lft-neg-out74.5%
distribute-neg-frac74.5%
distribute-neg-frac274.5%
distribute-lft-neg-out74.5%
distribute-rgt-neg-in74.5%
sub-neg74.5%
distribute-neg-in74.5%
remove-double-neg74.5%
+-commutative74.5%
sub-neg74.5%
sub-neg74.5%
distribute-neg-in74.5%
remove-double-neg74.5%
+-commutative74.5%
sub-neg74.5%
Simplified74.5%
*-commutative74.5%
associate-/l*97.4%
Applied egg-rr97.4%
Final simplification96.9%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (* x_m (/ (- z y) (- 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) {
return x_s * (x_m * ((z - y) / (z - t)));
}
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 * ((z - y) / (z - t)))
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 * ((z - y) / (z - t)));
}
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 * ((z - y) / (z - t)))
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(z - y) / Float64(z - t)))) 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 * ((z - y) / (z - t))); 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[(z - y), $MachinePrecision] / 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 \left(x\_m \cdot \frac{z - y}{z - t}\right)
\end{array}
Initial program 82.5%
associate-/l*96.2%
Simplified96.2%
Final simplification96.2%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s x_m))
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 82.5%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in z around inf 31.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 2024180
(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)))