
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= x_m 1e-10) (/ (* 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 <= 1e-10) {
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 <= 1d-10) 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 <= 1e-10) {
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 <= 1e-10: 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 <= 1e-10) 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 <= 1e-10) 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, 1e-10], 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 10^{-10}:\\
\;\;\;\;\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 < 1.00000000000000004e-10Initial program 89.2%
if 1.00000000000000004e-10 < x Initial program 72.7%
remove-double-neg72.7%
distribute-lft-neg-out72.7%
distribute-neg-frac72.7%
distribute-neg-frac272.7%
distribute-lft-neg-out72.7%
distribute-rgt-neg-in72.7%
sub-neg72.7%
distribute-neg-in72.7%
remove-double-neg72.7%
+-commutative72.7%
sub-neg72.7%
sub-neg72.7%
distribute-neg-in72.7%
remove-double-neg72.7%
+-commutative72.7%
sub-neg72.7%
Simplified72.7%
*-commutative72.7%
associate-/l*99.6%
Applied egg-rr99.6%
clear-num99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Final simplification92.0%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* x_m (/ y (- t z)))) (t_2 (* x_m (- 1.0 (/ y z)))))
(*
x_s
(if (<= z -0.32)
t_2
(if (<= z -2e-183)
t_1
(if (<= z 1.05e-273)
(/ (* x_m y) t)
(if (or (<= z 8.5e-35) (and (not (<= z 8e+45)) (<= z 1.76e+78)))
t_1
t_2)))))))x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m * (y / (t - z));
double t_2 = x_m * (1.0 - (y / z));
double tmp;
if (z <= -0.32) {
tmp = t_2;
} else if (z <= -2e-183) {
tmp = t_1;
} else if (z <= 1.05e-273) {
tmp = (x_m * y) / t;
} else if ((z <= 8.5e-35) || (!(z <= 8e+45) && (z <= 1.76e+78))) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x_m * (y / (t - z))
t_2 = x_m * (1.0d0 - (y / z))
if (z <= (-0.32d0)) then
tmp = t_2
else if (z <= (-2d-183)) then
tmp = t_1
else if (z <= 1.05d-273) then
tmp = (x_m * y) / t
else if ((z <= 8.5d-35) .or. (.not. (z <= 8d+45)) .and. (z <= 1.76d+78)) then
tmp = t_1
else
tmp = t_2
end if
code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m * (y / (t - z));
double t_2 = x_m * (1.0 - (y / z));
double tmp;
if (z <= -0.32) {
tmp = t_2;
} else if (z <= -2e-183) {
tmp = t_1;
} else if (z <= 1.05e-273) {
tmp = (x_m * y) / t;
} else if ((z <= 8.5e-35) || (!(z <= 8e+45) && (z <= 1.76e+78))) {
tmp = t_1;
} else {
tmp = t_2;
}
return x_s * tmp;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = x_m * (y / (t - z)) t_2 = x_m * (1.0 - (y / z)) tmp = 0 if z <= -0.32: tmp = t_2 elif z <= -2e-183: tmp = t_1 elif z <= 1.05e-273: tmp = (x_m * y) / t elif (z <= 8.5e-35) or (not (z <= 8e+45) and (z <= 1.76e+78)): tmp = t_1 else: tmp = t_2 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(y / Float64(t - z))) t_2 = Float64(x_m * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -0.32) tmp = t_2; elseif (z <= -2e-183) tmp = t_1; elseif (z <= 1.05e-273) tmp = Float64(Float64(x_m * y) / t); elseif ((z <= 8.5e-35) || (!(z <= 8e+45) && (z <= 1.76e+78))) tmp = t_1; else tmp = t_2; end return Float64(x_s * tmp) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = x_m * (y / (t - z)); t_2 = x_m * (1.0 - (y / z)); tmp = 0.0; if (z <= -0.32) tmp = t_2; elseif (z <= -2e-183) tmp = t_1; elseif (z <= 1.05e-273) tmp = (x_m * y) / t; elseif ((z <= 8.5e-35) || (~((z <= 8e+45)) && (z <= 1.76e+78))) tmp = t_1; else tmp = t_2; 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[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -0.32], t$95$2, If[LessEqual[z, -2e-183], t$95$1, If[LessEqual[z, 1.05e-273], N[(N[(x$95$m * y), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[z, 8.5e-35], And[N[Not[LessEqual[z, 8e+45]], $MachinePrecision], LessEqual[z, 1.76e+78]]], t$95$1, t$95$2]]]]), $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{y}{t - z}\\
t_2 := x\_m \cdot \left(1 - \frac{y}{z}\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -0.32:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-183}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-273}:\\
\;\;\;\;\frac{x\_m \cdot y}{t}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-35} \lor \neg \left(z \leq 8 \cdot 10^{+45}\right) \land z \leq 1.76 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if z < -0.320000000000000007 or 8.5000000000000001e-35 < z < 7.9999999999999994e45 or 1.76e78 < z Initial program 79.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 60.9%
*-commutative60.9%
associate-/l*75.6%
associate-*l*75.6%
associate-*l/75.6%
*-commutative75.6%
neg-mul-175.6%
neg-sub075.6%
associate--r-75.6%
neg-sub075.6%
+-commutative75.6%
sub-neg75.6%
div-sub75.6%
*-inverses75.6%
Simplified75.6%
if -0.320000000000000007 < z < -2.00000000000000001e-183 or 1.0500000000000001e-273 < z < 8.5000000000000001e-35 or 7.9999999999999994e45 < z < 1.76e78Initial program 88.4%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in y around inf 73.2%
associate-/l*81.2%
Simplified81.2%
if -2.00000000000000001e-183 < z < 1.0500000000000001e-273Initial program 94.9%
associate-/l*79.3%
Simplified79.3%
Taylor expanded in z around 0 85.8%
Final simplification79.0%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= y -2.6e+21)
(and (not (<= y -0.0013)) (or (<= y -1.65e-24) (not (<= y 7e+63)))))
(* x_m (/ y (- t z)))
(* 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 ((y <= -2.6e+21) || (!(y <= -0.0013) && ((y <= -1.65e-24) || !(y <= 7e+63)))) {
tmp = x_m * (y / (t - z));
} 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 ((y <= (-2.6d+21)) .or. (.not. (y <= (-0.0013d0))) .and. (y <= (-1.65d-24)) .or. (.not. (y <= 7d+63))) then
tmp = x_m * (y / (t - z))
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 ((y <= -2.6e+21) || (!(y <= -0.0013) && ((y <= -1.65e-24) || !(y <= 7e+63)))) {
tmp = x_m * (y / (t - z));
} 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 (y <= -2.6e+21) or (not (y <= -0.0013) and ((y <= -1.65e-24) or not (y <= 7e+63))): tmp = x_m * (y / (t - z)) 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 ((y <= -2.6e+21) || (!(y <= -0.0013) && ((y <= -1.65e-24) || !(y <= 7e+63)))) tmp = Float64(x_m * Float64(y / Float64(t - z))); 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 ((y <= -2.6e+21) || (~((y <= -0.0013)) && ((y <= -1.65e-24) || ~((y <= 7e+63))))) tmp = x_m * (y / (t - z)); 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[Or[LessEqual[y, -2.6e+21], And[N[Not[LessEqual[y, -0.0013]], $MachinePrecision], Or[LessEqual[y, -1.65e-24], N[Not[LessEqual[y, 7e+63]], $MachinePrecision]]]], N[(x$95$m * N[(y / N[(t - z), $MachinePrecision]), $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}\;y \leq -2.6 \cdot 10^{+21} \lor \neg \left(y \leq -0.0013\right) \land \left(y \leq -1.65 \cdot 10^{-24} \lor \neg \left(y \leq 7 \cdot 10^{+63}\right)\right):\\
\;\;\;\;x\_m \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if y < -2.6e21 or -0.0012999999999999999 < y < -1.64999999999999992e-24 or 7.00000000000000059e63 < y Initial program 82.9%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in y around inf 72.4%
associate-/l*83.5%
Simplified83.5%
if -2.6e21 < y < -0.0012999999999999999 or -1.64999999999999992e-24 < y < 7.00000000000000059e63Initial program 86.1%
associate-/l*95.5%
Simplified95.5%
Taylor expanded in y around 0 71.6%
mul-1-neg71.6%
distribute-neg-frac271.6%
neg-sub071.6%
associate--r-71.6%
neg-sub071.6%
mul-1-neg71.6%
+-commutative71.6%
mul-1-neg71.6%
sub-neg71.6%
associate-/l*82.0%
Simplified82.0%
Final simplification82.6%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* x_m (/ y (- t z)))))
(*
x_s
(if (<= y -4.7e+21)
t_1
(if (<= y -0.0027)
(/ x_m (- 1.0 (/ t z)))
(if (or (<= y -7e-24) (not (<= y 1.5e+63)))
t_1
(* 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 t_1 = x_m * (y / (t - z));
double tmp;
if (y <= -4.7e+21) {
tmp = t_1;
} else if (y <= -0.0027) {
tmp = x_m / (1.0 - (t / z));
} else if ((y <= -7e-24) || !(y <= 1.5e+63)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x_m * (y / (t - z))
if (y <= (-4.7d+21)) then
tmp = t_1
else if (y <= (-0.0027d0)) then
tmp = x_m / (1.0d0 - (t / z))
else if ((y <= (-7d-24)) .or. (.not. (y <= 1.5d+63))) then
tmp = t_1
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 t_1 = x_m * (y / (t - z));
double tmp;
if (y <= -4.7e+21) {
tmp = t_1;
} else if (y <= -0.0027) {
tmp = x_m / (1.0 - (t / z));
} else if ((y <= -7e-24) || !(y <= 1.5e+63)) {
tmp = t_1;
} 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): t_1 = x_m * (y / (t - z)) tmp = 0 if y <= -4.7e+21: tmp = t_1 elif y <= -0.0027: tmp = x_m / (1.0 - (t / z)) elif (y <= -7e-24) or not (y <= 1.5e+63): tmp = t_1 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) t_1 = Float64(x_m * Float64(y / Float64(t - z))) tmp = 0.0 if (y <= -4.7e+21) tmp = t_1; elseif (y <= -0.0027) tmp = Float64(x_m / Float64(1.0 - Float64(t / z))); elseif ((y <= -7e-24) || !(y <= 1.5e+63)) tmp = t_1; 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) t_1 = x_m * (y / (t - z)); tmp = 0.0; if (y <= -4.7e+21) tmp = t_1; elseif (y <= -0.0027) tmp = x_m / (1.0 - (t / z)); elseif ((y <= -7e-24) || ~((y <= 1.5e+63))) tmp = t_1; 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_] := Block[{t$95$1 = N[(x$95$m * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -4.7e+21], t$95$1, If[LessEqual[y, -0.0027], N[(x$95$m / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -7e-24], N[Not[LessEqual[y, 1.5e+63]], $MachinePrecision]], t$95$1, 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)
\\
\begin{array}{l}
t_1 := x\_m \cdot \frac{y}{t - z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -4.7 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -0.0027:\\
\;\;\;\;\frac{x\_m}{1 - \frac{t}{z}}\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-24} \lor \neg \left(y \leq 1.5 \cdot 10^{+63}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
\end{array}
if y < -4.7e21 or -0.0027000000000000001 < y < -6.9999999999999993e-24 or 1.5e63 < y Initial program 82.9%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in y around inf 72.4%
associate-/l*83.5%
Simplified83.5%
if -4.7e21 < y < -0.0027000000000000001Initial program 99.6%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 87.5%
mul-1-neg87.5%
distribute-neg-frac287.5%
neg-sub087.5%
associate--r-87.5%
neg-sub087.5%
mul-1-neg87.5%
+-commutative87.5%
mul-1-neg87.5%
sub-neg87.5%
associate-/l*87.6%
Simplified87.6%
Taylor expanded in x around 0 87.5%
associate-*l/75.6%
associate-/r/87.8%
div-sub87.8%
*-inverses87.8%
Simplified87.8%
if -6.9999999999999993e-24 < y < 1.5e63Initial program 85.3%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in y around 0 70.6%
mul-1-neg70.6%
distribute-neg-frac270.6%
neg-sub070.6%
associate--r-70.6%
neg-sub070.6%
mul-1-neg70.6%
+-commutative70.6%
mul-1-neg70.6%
sub-neg70.6%
associate-/l*81.6%
Simplified81.6%
Final simplification82.6%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* x_m (/ y (- t z)))))
(*
x_s
(if (<= y -4.1e+20)
t_1
(if (<= y -0.0032)
(/ x_m (- 1.0 (/ t z)))
(if (<= y -2.3e-24)
t_1
(if (<= y 5e+62) (* x_m (/ z (- z t))) (/ x_m (/ (- t z) y)))))))))x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m * (y / (t - z));
double tmp;
if (y <= -4.1e+20) {
tmp = t_1;
} else if (y <= -0.0032) {
tmp = x_m / (1.0 - (t / z));
} else if (y <= -2.3e-24) {
tmp = t_1;
} else if (y <= 5e+62) {
tmp = x_m * (z / (z - t));
} else {
tmp = x_m / ((t - z) / y);
}
return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x_m * (y / (t - z))
if (y <= (-4.1d+20)) then
tmp = t_1
else if (y <= (-0.0032d0)) then
tmp = x_m / (1.0d0 - (t / z))
else if (y <= (-2.3d-24)) then
tmp = t_1
else if (y <= 5d+62) then
tmp = x_m * (z / (z - t))
else
tmp = x_m / ((t - z) / y)
end if
code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m * (y / (t - z));
double tmp;
if (y <= -4.1e+20) {
tmp = t_1;
} else if (y <= -0.0032) {
tmp = x_m / (1.0 - (t / z));
} else if (y <= -2.3e-24) {
tmp = t_1;
} else if (y <= 5e+62) {
tmp = x_m * (z / (z - t));
} else {
tmp = x_m / ((t - z) / y);
}
return x_s * tmp;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = x_m * (y / (t - z)) tmp = 0 if y <= -4.1e+20: tmp = t_1 elif y <= -0.0032: tmp = x_m / (1.0 - (t / z)) elif y <= -2.3e-24: tmp = t_1 elif y <= 5e+62: tmp = x_m * (z / (z - t)) else: tmp = x_m / ((t - z) / y) return x_s * tmp
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m * Float64(y / Float64(t - z))) tmp = 0.0 if (y <= -4.1e+20) tmp = t_1; elseif (y <= -0.0032) tmp = Float64(x_m / Float64(1.0 - Float64(t / z))); elseif (y <= -2.3e-24) tmp = t_1; elseif (y <= 5e+62) tmp = Float64(x_m * Float64(z / Float64(z - t))); else tmp = Float64(x_m / Float64(Float64(t - z) / y)); end return Float64(x_s * tmp) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = x_m * (y / (t - z)); tmp = 0.0; if (y <= -4.1e+20) tmp = t_1; elseif (y <= -0.0032) tmp = x_m / (1.0 - (t / z)); elseif (y <= -2.3e-24) tmp = t_1; elseif (y <= 5e+62) tmp = x_m * (z / (z - t)); else tmp = x_m / ((t - z) / y); end tmp_2 = x_s * tmp; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -4.1e+20], t$95$1, If[LessEqual[y, -0.0032], N[(x$95$m / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.3e-24], t$95$1, If[LessEqual[y, 5e+62], N[(x$95$m * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]]), $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{y}{t - z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -0.0032:\\
\;\;\;\;\frac{x\_m}{1 - \frac{t}{z}}\\
\mathbf{elif}\;y \leq -2.3 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+62}:\\
\;\;\;\;x\_m \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\frac{t - z}{y}}\\
\end{array}
\end{array}
\end{array}
if y < -4.1e20 or -0.00320000000000000015 < y < -2.3000000000000001e-24Initial program 83.7%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in y around inf 71.1%
associate-/l*81.5%
Simplified81.5%
if -4.1e20 < y < -0.00320000000000000015Initial program 99.6%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 87.5%
mul-1-neg87.5%
distribute-neg-frac287.5%
neg-sub087.5%
associate--r-87.5%
neg-sub087.5%
mul-1-neg87.5%
+-commutative87.5%
mul-1-neg87.5%
sub-neg87.5%
associate-/l*87.6%
Simplified87.6%
Taylor expanded in x around 0 87.5%
associate-*l/75.6%
associate-/r/87.8%
div-sub87.8%
*-inverses87.8%
Simplified87.8%
if -2.3000000000000001e-24 < y < 5.00000000000000029e62Initial program 85.3%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in y around 0 70.6%
mul-1-neg70.6%
distribute-neg-frac270.6%
neg-sub070.6%
associate--r-70.6%
neg-sub070.6%
mul-1-neg70.6%
+-commutative70.6%
mul-1-neg70.6%
sub-neg70.6%
associate-/l*81.6%
Simplified81.6%
if 5.00000000000000029e62 < y Initial program 81.7%
associate-/l*93.6%
Simplified93.6%
clear-num93.4%
un-div-inv95.0%
Applied egg-rr95.0%
Taylor expanded in y around inf 87.6%
Final simplification82.9%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -4.3e+20)
(* x_m (/ y (- t z)))
(if (<= y -0.00172)
(/ x_m (- 1.0 (/ t z)))
(if (<= y -8.5e-25)
(/ (* x_m y) (- t z))
(if (<= y 5e+63) (* x_m (/ z (- z t))) (/ x_m (/ (- t z) y))))))))x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -4.3e+20) {
tmp = x_m * (y / (t - z));
} else if (y <= -0.00172) {
tmp = x_m / (1.0 - (t / z));
} else if (y <= -8.5e-25) {
tmp = (x_m * y) / (t - z);
} else if (y <= 5e+63) {
tmp = x_m * (z / (z - t));
} else {
tmp = x_m / ((t - z) / y);
}
return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-4.3d+20)) then
tmp = x_m * (y / (t - z))
else if (y <= (-0.00172d0)) then
tmp = x_m / (1.0d0 - (t / z))
else if (y <= (-8.5d-25)) then
tmp = (x_m * y) / (t - z)
else if (y <= 5d+63) then
tmp = x_m * (z / (z - t))
else
tmp = x_m / ((t - z) / y)
end if
code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -4.3e+20) {
tmp = x_m * (y / (t - z));
} else if (y <= -0.00172) {
tmp = x_m / (1.0 - (t / z));
} else if (y <= -8.5e-25) {
tmp = (x_m * y) / (t - z);
} else if (y <= 5e+63) {
tmp = x_m * (z / (z - t));
} else {
tmp = x_m / ((t - z) / y);
}
return x_s * tmp;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -4.3e+20: tmp = x_m * (y / (t - z)) elif y <= -0.00172: tmp = x_m / (1.0 - (t / z)) elif y <= -8.5e-25: tmp = (x_m * y) / (t - z) elif y <= 5e+63: tmp = x_m * (z / (z - t)) else: tmp = x_m / ((t - z) / y) return x_s * tmp
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -4.3e+20) tmp = Float64(x_m * Float64(y / Float64(t - z))); elseif (y <= -0.00172) tmp = Float64(x_m / Float64(1.0 - Float64(t / z))); elseif (y <= -8.5e-25) tmp = Float64(Float64(x_m * y) / Float64(t - z)); elseif (y <= 5e+63) tmp = Float64(x_m * Float64(z / Float64(z - t))); else tmp = Float64(x_m / Float64(Float64(t - z) / y)); end return Float64(x_s * tmp) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (y <= -4.3e+20) tmp = x_m * (y / (t - z)); elseif (y <= -0.00172) tmp = x_m / (1.0 - (t / z)); elseif (y <= -8.5e-25) tmp = (x_m * y) / (t - z); elseif (y <= 5e+63) tmp = x_m * (z / (z - t)); else tmp = x_m / ((t - z) / y); end tmp_2 = x_s * tmp; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -4.3e+20], N[(x$95$m * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -0.00172], N[(x$95$m / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -8.5e-25], N[(N[(x$95$m * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+63], N[(x$95$m * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(t - z), $MachinePrecision] / 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}\;y \leq -4.3 \cdot 10^{+20}:\\
\;\;\;\;x\_m \cdot \frac{y}{t - z}\\
\mathbf{elif}\;y \leq -0.00172:\\
\;\;\;\;\frac{x\_m}{1 - \frac{t}{z}}\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{-25}:\\
\;\;\;\;\frac{x\_m \cdot y}{t - z}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+63}:\\
\;\;\;\;x\_m \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\frac{t - z}{y}}\\
\end{array}
\end{array}
if y < -4.3e20Initial program 81.4%
associate-/l*98.1%
Simplified98.1%
Taylor expanded in y around inf 68.7%
associate-/l*80.6%
Simplified80.6%
if -4.3e20 < y < -0.00171999999999999996Initial program 99.6%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 87.5%
mul-1-neg87.5%
distribute-neg-frac287.5%
neg-sub087.5%
associate--r-87.5%
neg-sub087.5%
mul-1-neg87.5%
+-commutative87.5%
mul-1-neg87.5%
sub-neg87.5%
associate-/l*87.6%
Simplified87.6%
Taylor expanded in x around 0 87.5%
associate-*l/75.6%
associate-/r/87.8%
div-sub87.8%
*-inverses87.8%
Simplified87.8%
if -0.00171999999999999996 < y < -8.49999999999999981e-25Initial program 100.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 88.3%
if -8.49999999999999981e-25 < y < 5.00000000000000011e63Initial program 85.3%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in y around 0 70.6%
mul-1-neg70.6%
distribute-neg-frac270.6%
neg-sub070.6%
associate--r-70.6%
neg-sub070.6%
mul-1-neg70.6%
+-commutative70.6%
mul-1-neg70.6%
sub-neg70.6%
associate-/l*81.6%
Simplified81.6%
if 5.00000000000000011e63 < y Initial program 81.7%
associate-/l*93.6%
Simplified93.6%
clear-num93.4%
un-div-inv95.0%
Applied egg-rr95.0%
Taylor expanded in y around inf 87.6%
Final simplification82.9%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -8e-13) (not (<= z 2e-32)))
(* 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 <= -8e-13) || !(z <= 2e-32)) {
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 <= (-8d-13)) .or. (.not. (z <= 2d-32))) 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 <= -8e-13) || !(z <= 2e-32)) {
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 <= -8e-13) or not (z <= 2e-32): 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 <= -8e-13) || !(z <= 2e-32)) 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 <= -8e-13) || ~((z <= 2e-32))) 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, -8e-13], N[Not[LessEqual[z, 2e-32]], $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 -8 \cdot 10^{-13} \lor \neg \left(z \leq 2 \cdot 10^{-32}\right):\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -8.0000000000000002e-13 or 2.00000000000000011e-32 < z Initial program 78.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 58.9%
*-commutative58.9%
associate-/l*72.3%
associate-*l*72.3%
associate-*l/72.3%
*-commutative72.3%
neg-mul-172.3%
neg-sub072.3%
associate--r-72.3%
neg-sub072.3%
+-commutative72.3%
sub-neg72.3%
div-sub72.3%
*-inverses72.3%
Simplified72.3%
if -8.0000000000000002e-13 < z < 2.00000000000000011e-32Initial program 92.1%
associate-/l*90.7%
Simplified90.7%
clear-num89.5%
un-div-inv90.3%
Applied egg-rr90.3%
Taylor expanded in z around 0 69.5%
Final simplification71.1%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= z -8.8e+24) x_m (if (<= z 8.5e+77) (* 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 <= -8.8e+24) {
tmp = x_m;
} else if (z <= 8.5e+77) {
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 <= (-8.8d+24)) then
tmp = x_m
else if (z <= 8.5d+77) 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 <= -8.8e+24) {
tmp = x_m;
} else if (z <= 8.5e+77) {
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 <= -8.8e+24: tmp = x_m elif z <= 8.5e+77: 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 <= -8.8e+24) tmp = x_m; elseif (z <= 8.5e+77) 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 <= -8.8e+24) tmp = x_m; elseif (z <= 8.5e+77) 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, -8.8e+24], x$95$m, If[LessEqual[z, 8.5e+77], 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.8 \cdot 10^{+24}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+77}:\\
\;\;\;\;x\_m \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -8.80000000000000007e24 or 8.50000000000000018e77 < z Initial program 76.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 62.2%
if -8.80000000000000007e24 < z < 8.50000000000000018e77Initial program 91.7%
associate-/l*92.6%
Simplified92.6%
Taylor expanded in z around 0 61.5%
associate-/l*63.3%
Simplified63.3%
Final simplification62.8%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= z -4e+23) x_m (if (<= z 6.2e+77) (/ 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 <= -4e+23) {
tmp = x_m;
} else if (z <= 6.2e+77) {
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 <= (-4d+23)) then
tmp = x_m
else if (z <= 6.2d+77) 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 <= -4e+23) {
tmp = x_m;
} else if (z <= 6.2e+77) {
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 <= -4e+23: tmp = x_m elif z <= 6.2e+77: 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 <= -4e+23) tmp = x_m; elseif (z <= 6.2e+77) 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 <= -4e+23) tmp = x_m; elseif (z <= 6.2e+77) 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, -4e+23], x$95$m, If[LessEqual[z, 6.2e+77], 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 -4 \cdot 10^{+23}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+77}:\\
\;\;\;\;\frac{x\_m}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -3.9999999999999997e23 or 6.19999999999999997e77 < z Initial program 76.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 62.2%
if -3.9999999999999997e23 < z < 6.19999999999999997e77Initial program 91.7%
associate-/l*92.6%
Simplified92.6%
clear-num91.6%
un-div-inv92.3%
Applied egg-rr92.3%
Taylor expanded in z around 0 63.4%
Final simplification62.9%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= x_m 1.05e+20)
(* 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 <= 1.05e+20) {
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 <= 1.05d+20) 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 <= 1.05e+20) {
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 <= 1.05e+20: 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 <= 1.05e+20) tmp = Float64(x_m * Float64(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 <= 1.05e+20) 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, 1.05e+20], N[(x$95$m * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $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 1.05 \cdot 10^{+20}:\\
\;\;\;\;x\_m \cdot \frac{y - z}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\left(z - y\right) \cdot \frac{x\_m}{z - t}\\
\end{array}
\end{array}
if x < 1.05e20Initial program 89.7%
associate-/l*96.3%
Simplified96.3%
if 1.05e20 < x Initial program 68.7%
remove-double-neg68.7%
distribute-lft-neg-out68.7%
distribute-neg-frac68.7%
distribute-neg-frac268.7%
distribute-lft-neg-out68.7%
distribute-rgt-neg-in68.7%
sub-neg68.7%
distribute-neg-in68.7%
remove-double-neg68.7%
+-commutative68.7%
sub-neg68.7%
sub-neg68.7%
distribute-neg-in68.7%
remove-double-neg68.7%
+-commutative68.7%
sub-neg68.7%
Simplified68.7%
*-commutative68.7%
associate-/l*99.6%
Applied egg-rr99.6%
Final simplification97.1%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= x_m 1e+19) (/ x_m (/ (- t z) (- y 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 <= 1e+19) {
tmp = x_m / ((t - z) / (y - 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 <= 1d+19) then
tmp = x_m / ((t - z) / (y - 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 <= 1e+19) {
tmp = x_m / ((t - z) / (y - 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 <= 1e+19: tmp = x_m / ((t - z) / (y - 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 <= 1e+19) tmp = Float64(x_m / Float64(Float64(t - z) / Float64(y - 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 <= 1e+19) tmp = x_m / ((t - z) / (y - 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, 1e+19], N[(x$95$m / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $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 10^{+19}:\\
\;\;\;\;\frac{x\_m}{\frac{t - z}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;\left(z - y\right) \cdot \frac{x\_m}{z - t}\\
\end{array}
\end{array}
if x < 1e19Initial program 89.7%
associate-/l*96.3%
Simplified96.3%
clear-num95.9%
un-div-inv96.3%
Applied egg-rr96.3%
if 1e19 < x Initial program 68.7%
remove-double-neg68.7%
distribute-lft-neg-out68.7%
distribute-neg-frac68.7%
distribute-neg-frac268.7%
distribute-lft-neg-out68.7%
distribute-rgt-neg-in68.7%
sub-neg68.7%
distribute-neg-in68.7%
remove-double-neg68.7%
+-commutative68.7%
sub-neg68.7%
sub-neg68.7%
distribute-neg-in68.7%
remove-double-neg68.7%
+-commutative68.7%
sub-neg68.7%
Simplified68.7%
*-commutative68.7%
associate-/l*99.6%
Applied egg-rr99.6%
Final simplification97.1%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= x_m 1.4e-11)
(/ (* 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 <= 1.4e-11) {
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 <= 1.4d-11) 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 <= 1.4e-11) {
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 <= 1.4e-11: 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 <= 1.4e-11) 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 <= 1.4e-11) 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, 1.4e-11], 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 1.4 \cdot 10^{-11}:\\
\;\;\;\;\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 < 1.4e-11Initial program 89.2%
if 1.4e-11 < x Initial program 72.7%
remove-double-neg72.7%
distribute-lft-neg-out72.7%
distribute-neg-frac72.7%
distribute-neg-frac272.7%
distribute-lft-neg-out72.7%
distribute-rgt-neg-in72.7%
sub-neg72.7%
distribute-neg-in72.7%
remove-double-neg72.7%
+-commutative72.7%
sub-neg72.7%
sub-neg72.7%
distribute-neg-in72.7%
remove-double-neg72.7%
+-commutative72.7%
sub-neg72.7%
Simplified72.7%
*-commutative72.7%
associate-/l*99.6%
Applied egg-rr99.6%
Final simplification92.0%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 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.9%
Simplified95.9%
Final simplification95.9%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 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.9%
Simplified95.9%
Taylor expanded in z around inf 33.2%
Final simplification33.2%
(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 2024052
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:herbie-target
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))