
(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 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= x_m 1.22e-30)
(/ x_m (/ (- t z) (- y z)))
(* (/ x_m (- z 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 (x_m <= 1.22e-30) {
tmp = x_m / ((t - z) / (y - z));
} else {
tmp = (x_m / (z - 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 (x_m <= 1.22d-30) then
tmp = x_m / ((t - z) / (y - z))
else
tmp = (x_m / (z - 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 (x_m <= 1.22e-30) {
tmp = x_m / ((t - z) / (y - z));
} else {
tmp = (x_m / (z - 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 x_m <= 1.22e-30: tmp = x_m / ((t - z) / (y - z)) else: tmp = (x_m / (z - 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 (x_m <= 1.22e-30) tmp = Float64(x_m / Float64(Float64(t - z) / Float64(y - z))); else tmp = Float64(Float64(x_m / Float64(z - t)) * Float64(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 (x_m <= 1.22e-30) tmp = x_m / ((t - z) / (y - z)); else tmp = (x_m / (z - 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[x$95$m, 1.22e-30], N[(x$95$m / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(z - 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}\;x\_m \leq 1.22 \cdot 10^{-30}:\\
\;\;\;\;\frac{x\_m}{\frac{t - z}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z - t} \cdot \left(z - y\right)\\
\end{array}
\end{array}
if x < 1.22e-30Initial program 89.3%
associate-/l*95.5%
Simplified95.5%
clear-num94.8%
un-div-inv95.5%
Applied egg-rr95.5%
if 1.22e-30 < x Initial program 76.1%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in x around 0 76.1%
remove-double-neg76.1%
distribute-neg-frac276.1%
*-commutative76.1%
associate-/l*98.5%
distribute-lft-neg-out98.5%
neg-sub098.5%
associate--r-98.5%
neg-sub098.5%
+-commutative98.5%
sub-neg98.5%
neg-sub098.5%
associate--r-98.5%
neg-sub098.5%
+-commutative98.5%
sub-neg98.5%
*-commutative98.5%
Simplified98.5%
Final simplification96.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 (<= z -5.6e-22) (not (<= z 5.7e-40)))
(* 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 <= -5.6e-22) || !(z <= 5.7e-40)) {
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 <= (-5.6d-22)) .or. (.not. (z <= 5.7d-40))) 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 <= -5.6e-22) || !(z <= 5.7e-40)) {
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 <= -5.6e-22) or not (z <= 5.7e-40): 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 <= -5.6e-22) || !(z <= 5.7e-40)) 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 <= -5.6e-22) || ~((z <= 5.7e-40))) 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, -5.6e-22], N[Not[LessEqual[z, 5.7e-40]], $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 -5.6 \cdot 10^{-22} \lor \neg \left(z \leq 5.7 \cdot 10^{-40}\right):\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -5.5999999999999999e-22 or 5.69999999999999984e-40 < z Initial program 79.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 58.7%
mul-1-neg58.7%
associate-/l*71.5%
distribute-rgt-neg-in71.5%
distribute-frac-neg71.5%
neg-sub071.5%
associate--r-71.5%
neg-sub071.5%
+-commutative71.5%
sub-neg71.5%
div-sub71.5%
*-inverses71.5%
Simplified71.5%
if -5.5999999999999999e-22 < z < 5.69999999999999984e-40Initial program 91.9%
associate-/l*91.6%
Simplified91.6%
clear-num90.6%
un-div-inv91.7%
Applied egg-rr91.7%
Taylor expanded in z around 0 72.5%
Final simplification72.0%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -7.5e-18) (not (<= z 1.6e+157)))
(* x_m (- 1.0 (/ y z)))
(* x_m (/ y (- t z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -7.5e-18) || !(z <= 1.6e+157)) {
tmp = x_m * (1.0 - (y / z));
} else {
tmp = x_m * (y / (t - z));
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-7.5d-18)) .or. (.not. (z <= 1.6d+157))) then
tmp = x_m * (1.0d0 - (y / z))
else
tmp = x_m * (y / (t - z))
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -7.5e-18) || !(z <= 1.6e+157)) {
tmp = x_m * (1.0 - (y / z));
} else {
tmp = x_m * (y / (t - z));
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -7.5e-18) or not (z <= 1.6e+157): tmp = x_m * (1.0 - (y / z)) else: tmp = x_m * (y / (t - z)) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -7.5e-18) || !(z <= 1.6e+157)) tmp = Float64(x_m * Float64(1.0 - Float64(y / z))); else tmp = Float64(x_m * Float64(y / Float64(t - z))); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if ((z <= -7.5e-18) || ~((z <= 1.6e+157))) tmp = x_m * (1.0 - (y / z)); else tmp = x_m * (y / (t - z)); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -7.5e-18], N[Not[LessEqual[z, 1.6e+157]], $MachinePrecision]], N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-18} \lor \neg \left(z \leq 1.6 \cdot 10^{+157}\right):\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -7.50000000000000015e-18 or 1.6e157 < z Initial program 76.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 61.8%
mul-1-neg61.8%
associate-/l*78.0%
distribute-rgt-neg-in78.0%
distribute-frac-neg78.0%
neg-sub078.0%
associate--r-78.0%
neg-sub078.0%
+-commutative78.0%
sub-neg78.0%
div-sub78.1%
*-inverses78.1%
Simplified78.1%
if -7.50000000000000015e-18 < z < 1.6e157Initial program 91.1%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in y around inf 72.8%
associate-/l*75.2%
Simplified75.2%
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 (<= y -1.5e+24) (not (<= y 2.6e-5)))
(* 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 <= -1.5e+24) || !(y <= 2.6e-5)) {
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 <= (-1.5d+24)) .or. (.not. (y <= 2.6d-5))) 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 <= -1.5e+24) || !(y <= 2.6e-5)) {
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 <= -1.5e+24) or not (y <= 2.6e-5): 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 <= -1.5e+24) || !(y <= 2.6e-5)) 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 <= -1.5e+24) || ~((y <= 2.6e-5))) 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, -1.5e+24], N[Not[LessEqual[y, 2.6e-5]], $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 -1.5 \cdot 10^{+24} \lor \neg \left(y \leq 2.6 \cdot 10^{-5}\right):\\
\;\;\;\;x\_m \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if y < -1.49999999999999997e24 or 2.59999999999999984e-5 < y Initial program 84.4%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around inf 71.3%
associate-/l*78.6%
Simplified78.6%
if -1.49999999999999997e24 < y < 2.59999999999999984e-5Initial program 87.3%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in y around 0 70.1%
mul-1-neg70.1%
distribute-neg-frac270.1%
neg-sub070.1%
associate--r-70.1%
neg-sub070.1%
+-commutative70.1%
sub-neg70.1%
associate-/l*78.4%
Simplified78.4%
Final simplification78.5%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= z -2.75e-22)
(* x_m (- 1.0 (/ y z)))
(if (<= z 1.6e+157) (* x_m (/ (- y z) 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 <= -2.75e-22) {
tmp = x_m * (1.0 - (y / z));
} else if (z <= 1.6e+157) {
tmp = x_m * ((y - z) / 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 <= (-2.75d-22)) then
tmp = x_m * (1.0d0 - (y / z))
else if (z <= 1.6d+157) then
tmp = x_m * ((y - z) / 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 <= -2.75e-22) {
tmp = x_m * (1.0 - (y / z));
} else if (z <= 1.6e+157) {
tmp = x_m * ((y - z) / 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 <= -2.75e-22: tmp = x_m * (1.0 - (y / z)) elif z <= 1.6e+157: tmp = x_m * ((y - z) / 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 <= -2.75e-22) tmp = Float64(x_m * Float64(1.0 - Float64(y / z))); elseif (z <= 1.6e+157) tmp = Float64(x_m * Float64(Float64(y - z) / 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 <= -2.75e-22) tmp = x_m * (1.0 - (y / z)); elseif (z <= 1.6e+157) tmp = x_m * ((y - z) / 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, -2.75e-22], N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+157], N[(x$95$m * N[(N[(y - z), $MachinePrecision] / 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 -2.75 \cdot 10^{-22}:\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+157}:\\
\;\;\;\;x\_m \cdot \frac{y - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -2.7500000000000001e-22Initial program 74.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 56.4%
mul-1-neg56.4%
associate-/l*75.0%
distribute-rgt-neg-in75.0%
distribute-frac-neg75.0%
neg-sub075.0%
associate--r-75.0%
neg-sub075.0%
+-commutative75.0%
sub-neg75.0%
div-sub75.0%
*-inverses75.0%
Simplified75.0%
if -2.7500000000000001e-22 < z < 1.6e157Initial program 91.1%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in t around inf 78.2%
associate-/l*78.7%
Simplified78.7%
if 1.6e157 < z Initial program 83.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 71.0%
mul-1-neg71.0%
distribute-neg-frac271.0%
neg-sub071.0%
associate--r-71.0%
neg-sub071.0%
+-commutative71.0%
sub-neg71.0%
associate-/l*87.4%
Simplified87.4%
Final simplification78.8%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= z -6.1e-22)
(* x_m (- 1.0 (/ y z)))
(if (<= z 4.25e+99) (* (- 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 <= -6.1e-22) {
tmp = x_m * (1.0 - (y / z));
} else if (z <= 4.25e+99) {
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 <= (-6.1d-22)) then
tmp = x_m * (1.0d0 - (y / z))
else if (z <= 4.25d+99) 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 <= -6.1e-22) {
tmp = x_m * (1.0 - (y / z));
} else if (z <= 4.25e+99) {
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 <= -6.1e-22: tmp = x_m * (1.0 - (y / z)) elif z <= 4.25e+99: 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 <= -6.1e-22) tmp = Float64(x_m * Float64(1.0 - Float64(y / z))); elseif (z <= 4.25e+99) 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 <= -6.1e-22) tmp = x_m * (1.0 - (y / z)); elseif (z <= 4.25e+99) 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, -6.1e-22], N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.25e+99], 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 -6.1 \cdot 10^{-22}:\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 4.25 \cdot 10^{+99}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x\_m}{t}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -6.09999999999999957e-22Initial program 74.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 56.4%
mul-1-neg56.4%
associate-/l*75.0%
distribute-rgt-neg-in75.0%
distribute-frac-neg75.0%
neg-sub075.0%
associate--r-75.0%
neg-sub075.0%
+-commutative75.0%
sub-neg75.0%
div-sub75.0%
*-inverses75.0%
Simplified75.0%
if -6.09999999999999957e-22 < z < 4.24999999999999992e99Initial program 90.7%
associate-/l*92.9%
Simplified92.9%
Taylor expanded in t around inf 79.1%
*-commutative79.1%
associate-/l*81.5%
Applied egg-rr81.5%
if 4.24999999999999992e99 < z Initial program 86.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 66.0%
mul-1-neg66.0%
distribute-neg-frac266.0%
neg-sub066.0%
associate--r-66.0%
neg-sub066.0%
+-commutative66.0%
sub-neg66.0%
associate-/l*79.3%
Simplified79.3%
Final simplification79.5%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= z -5.4e-18) x_m (if (<= z 1.6e+157) (* 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 <= -5.4e-18) {
tmp = x_m;
} else if (z <= 1.6e+157) {
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 <= (-5.4d-18)) then
tmp = x_m
else if (z <= 1.6d+157) 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 <= -5.4e-18) {
tmp = x_m;
} else if (z <= 1.6e+157) {
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 <= -5.4e-18: tmp = x_m elif z <= 1.6e+157: 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 <= -5.4e-18) tmp = x_m; elseif (z <= 1.6e+157) 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 <= -5.4e-18) tmp = x_m; elseif (z <= 1.6e+157) 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, -5.4e-18], x$95$m, If[LessEqual[z, 1.6e+157], 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 -5.4 \cdot 10^{-18}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+157}:\\
\;\;\;\;x\_m \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -5.39999999999999977e-18 or 1.6e157 < z Initial program 76.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 64.5%
if -5.39999999999999977e-18 < z < 1.6e157Initial program 91.1%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in z around 0 64.9%
associate-/l*66.6%
Simplified66.6%
Final simplification65.8%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= z -3e-17) x_m (if (<= z 1.6e+157) (/ 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 <= -3e-17) {
tmp = x_m;
} else if (z <= 1.6e+157) {
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 <= (-3d-17)) then
tmp = x_m
else if (z <= 1.6d+157) 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 <= -3e-17) {
tmp = x_m;
} else if (z <= 1.6e+157) {
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 <= -3e-17: tmp = x_m elif z <= 1.6e+157: 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 <= -3e-17) tmp = x_m; elseif (z <= 1.6e+157) 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 <= -3e-17) tmp = x_m; elseif (z <= 1.6e+157) 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, -3e-17], x$95$m, If[LessEqual[z, 1.6e+157], 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 -3 \cdot 10^{-17}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+157}:\\
\;\;\;\;\frac{x\_m}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -3.00000000000000006e-17 or 1.6e157 < z Initial program 76.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 64.5%
if -3.00000000000000006e-17 < z < 1.6e157Initial program 91.1%
associate-/l*93.2%
Simplified93.2%
clear-num92.4%
un-div-inv93.3%
Applied egg-rr93.3%
Taylor expanded in z around 0 66.9%
Final simplification66.1%
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 1e-30) (* x_m (/ (- y z) (- t z))) (* (/ x_m (- z 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 (x_m <= 1e-30) {
tmp = x_m * ((y - z) / (t - z));
} else {
tmp = (x_m / (z - 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 (x_m <= 1d-30) then
tmp = x_m * ((y - z) / (t - z))
else
tmp = (x_m / (z - 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 (x_m <= 1e-30) {
tmp = x_m * ((y - z) / (t - z));
} else {
tmp = (x_m / (z - 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 x_m <= 1e-30: tmp = x_m * ((y - z) / (t - z)) else: tmp = (x_m / (z - 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 (x_m <= 1e-30) tmp = Float64(x_m * Float64(Float64(y - z) / Float64(t - z))); else tmp = Float64(Float64(x_m / Float64(z - t)) * Float64(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 (x_m <= 1e-30) tmp = x_m * ((y - z) / (t - z)); else tmp = (x_m / (z - 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[x$95$m, 1e-30], N[(x$95$m * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(z - 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}\;x\_m \leq 10^{-30}:\\
\;\;\;\;x\_m \cdot \frac{y - z}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z - t} \cdot \left(z - y\right)\\
\end{array}
\end{array}
if x < 1e-30Initial program 89.3%
associate-/l*95.5%
Simplified95.5%
if 1e-30 < x Initial program 76.1%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in x around 0 76.1%
remove-double-neg76.1%
distribute-neg-frac276.1%
*-commutative76.1%
associate-/l*98.5%
distribute-lft-neg-out98.5%
neg-sub098.5%
associate--r-98.5%
neg-sub098.5%
+-commutative98.5%
sub-neg98.5%
neg-sub098.5%
associate--r-98.5%
neg-sub098.5%
+-commutative98.5%
sub-neg98.5%
*-commutative98.5%
Simplified98.5%
Final simplification96.3%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (* x_m (/ (- y z) (- t z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m * ((y - z) / (t - z)));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x_s * (x_m * ((y - z) / (t - z)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m * ((y - z) / (t - z)));
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): return x_s * (x_m * ((y - z) / (t - z)))
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(x_m * Float64(Float64(y - z) / Float64(t - z)))) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z, t) tmp = x_s * (x_m * ((y - z) / (t - z))); end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \left(x\_m \cdot \frac{y - z}{t - z}\right)
\end{array}
Initial program 85.9%
associate-/l*95.7%
Simplified95.7%
Final simplification95.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 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 85.9%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in z around inf 29.3%
Final simplification29.3%
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((t - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
def code(x, y, z, t): return x / ((t - z) / (y - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(t - z) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) / (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
herbie shell --seed 2024075
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:alt
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))