
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
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 - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
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 - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
:precision binary64
(*
t_s
(if (<= t_m 7e+124)
(/ t_m (/ (- z y) (- x y)))
(/ (- x y) (/ (- z y) t_m)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if (t_m <= 7e+124) {
tmp = t_m / ((z - y) / (x - y));
} else {
tmp = (x - y) / ((z - y) / t_m);
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if (t_m <= 7d+124) then
tmp = t_m / ((z - y) / (x - y))
else
tmp = (x - y) / ((z - y) / t_m)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if (t_m <= 7e+124) {
tmp = t_m / ((z - y) / (x - y));
} else {
tmp = (x - y) / ((z - y) / t_m);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, y, z, t_m): tmp = 0 if t_m <= 7e+124: tmp = t_m / ((z - y) / (x - y)) else: tmp = (x - y) / ((z - y) / t_m) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, y, z, t_m) tmp = 0.0 if (t_m <= 7e+124) tmp = Float64(t_m / Float64(Float64(z - y) / Float64(x - y))); else tmp = Float64(Float64(x - y) / Float64(Float64(z - y) / t_m)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, y, z, t_m) tmp = 0.0; if (t_m <= 7e+124) tmp = t_m / ((z - y) / (x - y)); else tmp = (x - y) / ((z - y) / t_m); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 7e+124], N[(t$95$m / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] / N[(N[(z - y), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 7 \cdot 10^{+124}:\\
\;\;\;\;\frac{t\_m}{\frac{z - y}{x - y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y}{\frac{z - y}{t\_m}}\\
\end{array}
\end{array}
if t < 7.0000000000000002e124Initial program 96.0%
associate-*l/86.5%
associate-/l*79.3%
Simplified79.3%
associate-*r/86.5%
associate-*l/96.0%
*-commutative96.0%
clear-num95.9%
un-div-inv96.0%
Applied egg-rr96.0%
if 7.0000000000000002e124 < t Initial program 96.9%
associate-*l/58.6%
associate-/l*99.7%
Simplified99.7%
clear-num99.5%
un-div-inv99.7%
Applied egg-rr99.7%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
:precision binary64
(let* ((t_2 (* t_m (- 1.0 (/ x y)))))
(*
t_s
(if (<= y -6.5e-9)
t_2
(if (<= y -6e-161)
(/ (* t_m x) (- z y))
(if (<= y 4.15e+40) (* (- x y) (/ t_m z)) t_2))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
double t_2 = t_m * (1.0 - (x / y));
double tmp;
if (y <= -6.5e-9) {
tmp = t_2;
} else if (y <= -6e-161) {
tmp = (t_m * x) / (z - y);
} else if (y <= 4.15e+40) {
tmp = (x - y) * (t_m / z);
} else {
tmp = t_2;
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: t_2
real(8) :: tmp
t_2 = t_m * (1.0d0 - (x / y))
if (y <= (-6.5d-9)) then
tmp = t_2
else if (y <= (-6d-161)) then
tmp = (t_m * x) / (z - y)
else if (y <= 4.15d+40) then
tmp = (x - y) * (t_m / z)
else
tmp = t_2
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
double t_2 = t_m * (1.0 - (x / y));
double tmp;
if (y <= -6.5e-9) {
tmp = t_2;
} else if (y <= -6e-161) {
tmp = (t_m * x) / (z - y);
} else if (y <= 4.15e+40) {
tmp = (x - y) * (t_m / z);
} else {
tmp = t_2;
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, y, z, t_m): t_2 = t_m * (1.0 - (x / y)) tmp = 0 if y <= -6.5e-9: tmp = t_2 elif y <= -6e-161: tmp = (t_m * x) / (z - y) elif y <= 4.15e+40: tmp = (x - y) * (t_m / z) else: tmp = t_2 return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, y, z, t_m) t_2 = Float64(t_m * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (y <= -6.5e-9) tmp = t_2; elseif (y <= -6e-161) tmp = Float64(Float64(t_m * x) / Float64(z - y)); elseif (y <= 4.15e+40) tmp = Float64(Float64(x - y) * Float64(t_m / z)); else tmp = t_2; end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, y, z, t_m) t_2 = t_m * (1.0 - (x / y)); tmp = 0.0; if (y <= -6.5e-9) tmp = t_2; elseif (y <= -6e-161) tmp = (t_m * x) / (z - y); elseif (y <= 4.15e+40) tmp = (x - y) * (t_m / z); else tmp = t_2; end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := Block[{t$95$2 = N[(t$95$m * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[y, -6.5e-9], t$95$2, If[LessEqual[y, -6e-161], N[(N[(t$95$m * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.15e+40], N[(N[(x - y), $MachinePrecision] * N[(t$95$m / z), $MachinePrecision]), $MachinePrecision], t$95$2]]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := t\_m \cdot \left(1 - \frac{x}{y}\right)\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{-9}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -6 \cdot 10^{-161}:\\
\;\;\;\;\frac{t\_m \cdot x}{z - y}\\
\mathbf{elif}\;y \leq 4.15 \cdot 10^{+40}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t\_m}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if y < -6.5000000000000003e-9 or 4.1499999999999999e40 < y Initial program 99.9%
associate-*l/72.9%
associate-/l*72.3%
Simplified72.3%
associate-*r/72.9%
associate-*l/99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 80.4%
neg-mul-180.4%
distribute-neg-frac280.4%
sub-neg80.4%
distribute-neg-in80.4%
remove-double-neg80.4%
Simplified80.4%
Taylor expanded in y around inf 71.8%
*-rgt-identity71.8%
neg-mul-171.8%
associate-/l*80.4%
distribute-rgt-neg-in80.4%
mul-1-neg80.4%
distribute-lft-out80.4%
mul-1-neg80.4%
unsub-neg80.4%
Simplified80.4%
if -6.5000000000000003e-9 < y < -5.99999999999999977e-161Initial program 96.8%
associate-*l/94.0%
associate-/l*87.4%
Simplified87.4%
Taylor expanded in x around inf 71.9%
if -5.99999999999999977e-161 < y < 4.1499999999999999e40Initial program 90.8%
associate-*l/91.8%
associate-/l*93.7%
Simplified93.7%
Taylor expanded in z around inf 83.4%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
:precision binary64
(*
t_s
(if (<= y -2.4e+199)
t_m
(if (<= y -6.5e-9)
(* (/ x y) (- t_m))
(if (<= y 3.6e+40) (/ t_m (/ z x)) t_m)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if (y <= -2.4e+199) {
tmp = t_m;
} else if (y <= -6.5e-9) {
tmp = (x / y) * -t_m;
} else if (y <= 3.6e+40) {
tmp = t_m / (z / x);
} else {
tmp = t_m;
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if (y <= (-2.4d+199)) then
tmp = t_m
else if (y <= (-6.5d-9)) then
tmp = (x / y) * -t_m
else if (y <= 3.6d+40) then
tmp = t_m / (z / x)
else
tmp = t_m
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if (y <= -2.4e+199) {
tmp = t_m;
} else if (y <= -6.5e-9) {
tmp = (x / y) * -t_m;
} else if (y <= 3.6e+40) {
tmp = t_m / (z / x);
} else {
tmp = t_m;
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, y, z, t_m): tmp = 0 if y <= -2.4e+199: tmp = t_m elif y <= -6.5e-9: tmp = (x / y) * -t_m elif y <= 3.6e+40: tmp = t_m / (z / x) else: tmp = t_m return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, y, z, t_m) tmp = 0.0 if (y <= -2.4e+199) tmp = t_m; elseif (y <= -6.5e-9) tmp = Float64(Float64(x / y) * Float64(-t_m)); elseif (y <= 3.6e+40) tmp = Float64(t_m / Float64(z / x)); else tmp = t_m; end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, y, z, t_m) tmp = 0.0; if (y <= -2.4e+199) tmp = t_m; elseif (y <= -6.5e-9) tmp = (x / y) * -t_m; elseif (y <= 3.6e+40) tmp = t_m / (z / x); else tmp = t_m; end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -2.4e+199], t$95$m, If[LessEqual[y, -6.5e-9], N[(N[(x / y), $MachinePrecision] * (-t$95$m)), $MachinePrecision], If[LessEqual[y, 3.6e+40], N[(t$95$m / N[(z / x), $MachinePrecision]), $MachinePrecision], t$95$m]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+199}:\\
\;\;\;\;t\_m\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-9}:\\
\;\;\;\;\frac{x}{y} \cdot \left(-t\_m\right)\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+40}:\\
\;\;\;\;\frac{t\_m}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\_m\\
\end{array}
\end{array}
if y < -2.40000000000000015e199 or 3.59999999999999996e40 < y Initial program 99.9%
associate-*l/68.5%
associate-/l*68.6%
Simplified68.6%
Taylor expanded in y around inf 70.0%
if -2.40000000000000015e199 < y < -6.5000000000000003e-9Initial program 99.8%
associate-*l/83.2%
associate-/l*81.0%
Simplified81.0%
associate-*r/83.2%
associate-*l/99.8%
*-commutative99.8%
clear-num99.6%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in z around 0 66.8%
neg-mul-166.8%
distribute-neg-frac266.8%
sub-neg66.8%
distribute-neg-in66.8%
remove-double-neg66.8%
Simplified66.8%
Taylor expanded in y around 0 42.8%
neg-mul-142.8%
distribute-frac-neg242.8%
associate-/l*49.8%
Simplified49.8%
if -6.5000000000000003e-9 < y < 3.59999999999999996e40Initial program 92.3%
associate-*l/92.4%
associate-/l*92.1%
Simplified92.1%
associate-*r/92.4%
associate-*l/92.3%
*-commutative92.3%
clear-num92.3%
un-div-inv92.4%
Applied egg-rr92.4%
Taylor expanded in y around 0 65.4%
Final simplification64.7%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
:precision binary64
(*
t_s
(if (or (<= y -5.6e+73) (not (<= y 7.2e+115)))
(/ t_m (/ y (- y x)))
(* (- x y) (/ t_m (- z y))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if ((y <= -5.6e+73) || !(y <= 7.2e+115)) {
tmp = t_m / (y / (y - x));
} else {
tmp = (x - y) * (t_m / (z - y));
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if ((y <= (-5.6d+73)) .or. (.not. (y <= 7.2d+115))) then
tmp = t_m / (y / (y - x))
else
tmp = (x - y) * (t_m / (z - y))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if ((y <= -5.6e+73) || !(y <= 7.2e+115)) {
tmp = t_m / (y / (y - x));
} else {
tmp = (x - y) * (t_m / (z - y));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, y, z, t_m): tmp = 0 if (y <= -5.6e+73) or not (y <= 7.2e+115): tmp = t_m / (y / (y - x)) else: tmp = (x - y) * (t_m / (z - y)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, y, z, t_m) tmp = 0.0 if ((y <= -5.6e+73) || !(y <= 7.2e+115)) tmp = Float64(t_m / Float64(y / Float64(y - x))); else tmp = Float64(Float64(x - y) * Float64(t_m / Float64(z - y))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, y, z, t_m) tmp = 0.0; if ((y <= -5.6e+73) || ~((y <= 7.2e+115))) tmp = t_m / (y / (y - x)); else tmp = (x - y) * (t_m / (z - y)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[Or[LessEqual[y, -5.6e+73], N[Not[LessEqual[y, 7.2e+115]], $MachinePrecision]], N[(t$95$m / N[(y / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(t$95$m / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{+73} \lor \neg \left(y \leq 7.2 \cdot 10^{+115}\right):\\
\;\;\;\;\frac{t\_m}{\frac{y}{y - x}}\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t\_m}{z - y}\\
\end{array}
\end{array}
if y < -5.60000000000000016e73 or 7.2000000000000001e115 < y Initial program 99.9%
associate-*l/66.2%
associate-/l*64.6%
Simplified64.6%
associate-*r/66.2%
associate-*l/99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 84.6%
neg-mul-184.6%
distribute-neg-frac284.6%
sub-neg84.6%
distribute-neg-in84.6%
remove-double-neg84.6%
Simplified84.6%
Taylor expanded in x around 0 84.6%
mul-1-neg84.6%
sub-neg84.6%
Simplified84.6%
if -5.60000000000000016e73 < y < 7.2000000000000001e115Initial program 93.9%
associate-*l/92.2%
associate-/l*92.5%
Simplified92.5%
Final simplification89.6%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
:precision binary64
(*
t_s
(if (or (<= y -2.15e-10) (not (<= y 6.3e+39)))
(* t_m (- 1.0 (/ x y)))
(/ (* t_m (- x y)) z))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if ((y <= -2.15e-10) || !(y <= 6.3e+39)) {
tmp = t_m * (1.0 - (x / y));
} else {
tmp = (t_m * (x - y)) / z;
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if ((y <= (-2.15d-10)) .or. (.not. (y <= 6.3d+39))) then
tmp = t_m * (1.0d0 - (x / y))
else
tmp = (t_m * (x - y)) / z
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if ((y <= -2.15e-10) || !(y <= 6.3e+39)) {
tmp = t_m * (1.0 - (x / y));
} else {
tmp = (t_m * (x - y)) / z;
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, y, z, t_m): tmp = 0 if (y <= -2.15e-10) or not (y <= 6.3e+39): tmp = t_m * (1.0 - (x / y)) else: tmp = (t_m * (x - y)) / z return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, y, z, t_m) tmp = 0.0 if ((y <= -2.15e-10) || !(y <= 6.3e+39)) tmp = Float64(t_m * Float64(1.0 - Float64(x / y))); else tmp = Float64(Float64(t_m * Float64(x - y)) / z); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, y, z, t_m) tmp = 0.0; if ((y <= -2.15e-10) || ~((y <= 6.3e+39))) tmp = t_m * (1.0 - (x / y)); else tmp = (t_m * (x - y)) / z; end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[Or[LessEqual[y, -2.15e-10], N[Not[LessEqual[y, 6.3e+39]], $MachinePrecision]], N[(t$95$m * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$m * N[(x - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{-10} \lor \neg \left(y \leq 6.3 \cdot 10^{+39}\right):\\
\;\;\;\;t\_m \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_m \cdot \left(x - y\right)}{z}\\
\end{array}
\end{array}
if y < -2.15000000000000007e-10 or 6.2999999999999996e39 < y Initial program 99.9%
associate-*l/72.9%
associate-/l*72.3%
Simplified72.3%
associate-*r/72.9%
associate-*l/99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 80.4%
neg-mul-180.4%
distribute-neg-frac280.4%
sub-neg80.4%
distribute-neg-in80.4%
remove-double-neg80.4%
Simplified80.4%
Taylor expanded in y around inf 71.8%
*-rgt-identity71.8%
neg-mul-171.8%
associate-/l*80.4%
distribute-rgt-neg-in80.4%
mul-1-neg80.4%
distribute-lft-out80.4%
mul-1-neg80.4%
unsub-neg80.4%
Simplified80.4%
if -2.15000000000000007e-10 < y < 6.2999999999999996e39Initial program 92.3%
associate-*l/92.4%
associate-/l*92.1%
Simplified92.1%
Taylor expanded in z around inf 78.1%
Final simplification79.2%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
:precision binary64
(*
t_s
(if (or (<= y -2.15e-12) (not (<= y 4.8e+39)))
(* t_m (- 1.0 (/ x y)))
(* (- x y) (/ t_m z)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if ((y <= -2.15e-12) || !(y <= 4.8e+39)) {
tmp = t_m * (1.0 - (x / y));
} else {
tmp = (x - y) * (t_m / z);
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if ((y <= (-2.15d-12)) .or. (.not. (y <= 4.8d+39))) then
tmp = t_m * (1.0d0 - (x / y))
else
tmp = (x - y) * (t_m / z)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if ((y <= -2.15e-12) || !(y <= 4.8e+39)) {
tmp = t_m * (1.0 - (x / y));
} else {
tmp = (x - y) * (t_m / z);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, y, z, t_m): tmp = 0 if (y <= -2.15e-12) or not (y <= 4.8e+39): tmp = t_m * (1.0 - (x / y)) else: tmp = (x - y) * (t_m / z) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, y, z, t_m) tmp = 0.0 if ((y <= -2.15e-12) || !(y <= 4.8e+39)) tmp = Float64(t_m * Float64(1.0 - Float64(x / y))); else tmp = Float64(Float64(x - y) * Float64(t_m / z)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, y, z, t_m) tmp = 0.0; if ((y <= -2.15e-12) || ~((y <= 4.8e+39))) tmp = t_m * (1.0 - (x / y)); else tmp = (x - y) * (t_m / z); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[Or[LessEqual[y, -2.15e-12], N[Not[LessEqual[y, 4.8e+39]], $MachinePrecision]], N[(t$95$m * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(t$95$m / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{-12} \lor \neg \left(y \leq 4.8 \cdot 10^{+39}\right):\\
\;\;\;\;t\_m \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t\_m}{z}\\
\end{array}
\end{array}
if y < -2.14999999999999993e-12 or 4.8000000000000002e39 < y Initial program 99.9%
associate-*l/72.9%
associate-/l*72.3%
Simplified72.3%
associate-*r/72.9%
associate-*l/99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 80.4%
neg-mul-180.4%
distribute-neg-frac280.4%
sub-neg80.4%
distribute-neg-in80.4%
remove-double-neg80.4%
Simplified80.4%
Taylor expanded in y around inf 71.8%
*-rgt-identity71.8%
neg-mul-171.8%
associate-/l*80.4%
distribute-rgt-neg-in80.4%
mul-1-neg80.4%
distribute-lft-out80.4%
mul-1-neg80.4%
unsub-neg80.4%
Simplified80.4%
if -2.14999999999999993e-12 < y < 4.8000000000000002e39Initial program 92.3%
associate-*l/92.4%
associate-/l*92.1%
Simplified92.1%
Taylor expanded in z around inf 77.0%
Final simplification78.7%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
:precision binary64
(*
t_s
(if (or (<= y -1.85e-10) (not (<= y 4e+40)))
(* t_m (- 1.0 (/ x y)))
(* x (/ t_m (- z y))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if ((y <= -1.85e-10) || !(y <= 4e+40)) {
tmp = t_m * (1.0 - (x / y));
} else {
tmp = x * (t_m / (z - y));
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if ((y <= (-1.85d-10)) .or. (.not. (y <= 4d+40))) then
tmp = t_m * (1.0d0 - (x / y))
else
tmp = x * (t_m / (z - y))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if ((y <= -1.85e-10) || !(y <= 4e+40)) {
tmp = t_m * (1.0 - (x / y));
} else {
tmp = x * (t_m / (z - y));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, y, z, t_m): tmp = 0 if (y <= -1.85e-10) or not (y <= 4e+40): tmp = t_m * (1.0 - (x / y)) else: tmp = x * (t_m / (z - y)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, y, z, t_m) tmp = 0.0 if ((y <= -1.85e-10) || !(y <= 4e+40)) tmp = Float64(t_m * Float64(1.0 - Float64(x / y))); else tmp = Float64(x * Float64(t_m / Float64(z - y))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, y, z, t_m) tmp = 0.0; if ((y <= -1.85e-10) || ~((y <= 4e+40))) tmp = t_m * (1.0 - (x / y)); else tmp = x * (t_m / (z - y)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[Or[LessEqual[y, -1.85e-10], N[Not[LessEqual[y, 4e+40]], $MachinePrecision]], N[(t$95$m * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t$95$m / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-10} \lor \neg \left(y \leq 4 \cdot 10^{+40}\right):\\
\;\;\;\;t\_m \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t\_m}{z - y}\\
\end{array}
\end{array}
if y < -1.85000000000000007e-10 or 4.00000000000000012e40 < y Initial program 99.9%
associate-*l/72.9%
associate-/l*72.3%
Simplified72.3%
associate-*r/72.9%
associate-*l/99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 80.4%
neg-mul-180.4%
distribute-neg-frac280.4%
sub-neg80.4%
distribute-neg-in80.4%
remove-double-neg80.4%
Simplified80.4%
Taylor expanded in y around inf 71.8%
*-rgt-identity71.8%
neg-mul-171.8%
associate-/l*80.4%
distribute-rgt-neg-in80.4%
mul-1-neg80.4%
distribute-lft-out80.4%
mul-1-neg80.4%
unsub-neg80.4%
Simplified80.4%
if -1.85000000000000007e-10 < y < 4.00000000000000012e40Initial program 92.3%
associate-*l/92.4%
associate-/l*92.1%
Simplified92.1%
Taylor expanded in x around inf 72.1%
Final simplification76.3%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
:precision binary64
(*
t_s
(if (or (<= y -8e-15) (not (<= y 4.3e-63)))
(* t_m (- 1.0 (/ x y)))
(/ (* t_m x) z))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if ((y <= -8e-15) || !(y <= 4.3e-63)) {
tmp = t_m * (1.0 - (x / y));
} else {
tmp = (t_m * x) / z;
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if ((y <= (-8d-15)) .or. (.not. (y <= 4.3d-63))) then
tmp = t_m * (1.0d0 - (x / y))
else
tmp = (t_m * x) / z
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if ((y <= -8e-15) || !(y <= 4.3e-63)) {
tmp = t_m * (1.0 - (x / y));
} else {
tmp = (t_m * x) / z;
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, y, z, t_m): tmp = 0 if (y <= -8e-15) or not (y <= 4.3e-63): tmp = t_m * (1.0 - (x / y)) else: tmp = (t_m * x) / z return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, y, z, t_m) tmp = 0.0 if ((y <= -8e-15) || !(y <= 4.3e-63)) tmp = Float64(t_m * Float64(1.0 - Float64(x / y))); else tmp = Float64(Float64(t_m * x) / z); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, y, z, t_m) tmp = 0.0; if ((y <= -8e-15) || ~((y <= 4.3e-63))) tmp = t_m * (1.0 - (x / y)); else tmp = (t_m * x) / z; end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[Or[LessEqual[y, -8e-15], N[Not[LessEqual[y, 4.3e-63]], $MachinePrecision]], N[(t$95$m * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$m * x), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{-15} \lor \neg \left(y \leq 4.3 \cdot 10^{-63}\right):\\
\;\;\;\;t\_m \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_m \cdot x}{z}\\
\end{array}
\end{array}
if y < -8.0000000000000006e-15 or 4.2999999999999999e-63 < y Initial program 99.8%
associate-*l/75.3%
associate-/l*76.6%
Simplified76.6%
associate-*r/75.3%
associate-*l/99.8%
*-commutative99.8%
clear-num99.7%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 74.8%
neg-mul-174.8%
distribute-neg-frac274.8%
sub-neg74.8%
distribute-neg-in74.8%
remove-double-neg74.8%
Simplified74.8%
Taylor expanded in y around inf 67.5%
*-rgt-identity67.5%
neg-mul-167.5%
associate-/l*74.8%
distribute-rgt-neg-in74.8%
mul-1-neg74.8%
distribute-lft-out74.8%
mul-1-neg74.8%
unsub-neg74.8%
Simplified74.8%
if -8.0000000000000006e-15 < y < 4.2999999999999999e-63Initial program 90.6%
associate-*l/93.4%
associate-/l*90.4%
Simplified90.4%
Taylor expanded in y around 0 72.7%
Final simplification73.9%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x y z t_m) :precision binary64 (* t_s (if (<= y -5.8e+113) t_m (if (<= y 1.65e+40) (/ t_m (/ z x)) t_m))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if (y <= -5.8e+113) {
tmp = t_m;
} else if (y <= 1.65e+40) {
tmp = t_m / (z / x);
} else {
tmp = t_m;
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if (y <= (-5.8d+113)) then
tmp = t_m
else if (y <= 1.65d+40) then
tmp = t_m / (z / x)
else
tmp = t_m
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if (y <= -5.8e+113) {
tmp = t_m;
} else if (y <= 1.65e+40) {
tmp = t_m / (z / x);
} else {
tmp = t_m;
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, y, z, t_m): tmp = 0 if y <= -5.8e+113: tmp = t_m elif y <= 1.65e+40: tmp = t_m / (z / x) else: tmp = t_m return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, y, z, t_m) tmp = 0.0 if (y <= -5.8e+113) tmp = t_m; elseif (y <= 1.65e+40) tmp = Float64(t_m / Float64(z / x)); else tmp = t_m; end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, y, z, t_m) tmp = 0.0; if (y <= -5.8e+113) tmp = t_m; elseif (y <= 1.65e+40) tmp = t_m / (z / x); else tmp = t_m; end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -5.8e+113], t$95$m, If[LessEqual[y, 1.65e+40], N[(t$95$m / N[(z / x), $MachinePrecision]), $MachinePrecision], t$95$m]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+113}:\\
\;\;\;\;t\_m\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+40}:\\
\;\;\;\;\frac{t\_m}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\_m\\
\end{array}
\end{array}
if y < -5.79999999999999968e113 or 1.6499999999999999e40 < y Initial program 99.9%
associate-*l/67.5%
associate-/l*68.6%
Simplified68.6%
Taylor expanded in y around inf 64.7%
if -5.79999999999999968e113 < y < 1.6499999999999999e40Initial program 93.7%
associate-*l/92.6%
associate-/l*91.1%
Simplified91.1%
associate-*r/92.6%
associate-*l/93.7%
*-commutative93.7%
clear-num93.6%
un-div-inv93.7%
Applied egg-rr93.7%
Taylor expanded in y around 0 57.2%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x y z t_m) :precision binary64 (* t_s (if (<= y -4.3e+113) t_m (if (<= y 2.55e+40) (* t_m (/ x z)) t_m))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if (y <= -4.3e+113) {
tmp = t_m;
} else if (y <= 2.55e+40) {
tmp = t_m * (x / z);
} else {
tmp = t_m;
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if (y <= (-4.3d+113)) then
tmp = t_m
else if (y <= 2.55d+40) then
tmp = t_m * (x / z)
else
tmp = t_m
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if (y <= -4.3e+113) {
tmp = t_m;
} else if (y <= 2.55e+40) {
tmp = t_m * (x / z);
} else {
tmp = t_m;
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, y, z, t_m): tmp = 0 if y <= -4.3e+113: tmp = t_m elif y <= 2.55e+40: tmp = t_m * (x / z) else: tmp = t_m return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, y, z, t_m) tmp = 0.0 if (y <= -4.3e+113) tmp = t_m; elseif (y <= 2.55e+40) tmp = Float64(t_m * Float64(x / z)); else tmp = t_m; end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, y, z, t_m) tmp = 0.0; if (y <= -4.3e+113) tmp = t_m; elseif (y <= 2.55e+40) tmp = t_m * (x / z); else tmp = t_m; end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -4.3e+113], t$95$m, If[LessEqual[y, 2.55e+40], N[(t$95$m * N[(x / z), $MachinePrecision]), $MachinePrecision], t$95$m]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -4.3 \cdot 10^{+113}:\\
\;\;\;\;t\_m\\
\mathbf{elif}\;y \leq 2.55 \cdot 10^{+40}:\\
\;\;\;\;t\_m \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_m\\
\end{array}
\end{array}
if y < -4.3000000000000003e113 or 2.54999999999999979e40 < y Initial program 99.9%
associate-*l/67.5%
associate-/l*68.6%
Simplified68.6%
Taylor expanded in y around inf 64.7%
if -4.3000000000000003e113 < y < 2.54999999999999979e40Initial program 93.7%
Taylor expanded in y around 0 57.1%
Final simplification60.1%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x y z t_m) :precision binary64 (* t_s (if (<= y -6.5e-9) t_m (if (<= y 6.2e+40) (* x (/ t_m z)) t_m))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if (y <= -6.5e-9) {
tmp = t_m;
} else if (y <= 6.2e+40) {
tmp = x * (t_m / z);
} else {
tmp = t_m;
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if (y <= (-6.5d-9)) then
tmp = t_m
else if (y <= 6.2d+40) then
tmp = x * (t_m / z)
else
tmp = t_m
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if (y <= -6.5e-9) {
tmp = t_m;
} else if (y <= 6.2e+40) {
tmp = x * (t_m / z);
} else {
tmp = t_m;
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, y, z, t_m): tmp = 0 if y <= -6.5e-9: tmp = t_m elif y <= 6.2e+40: tmp = x * (t_m / z) else: tmp = t_m return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, y, z, t_m) tmp = 0.0 if (y <= -6.5e-9) tmp = t_m; elseif (y <= 6.2e+40) tmp = Float64(x * Float64(t_m / z)); else tmp = t_m; end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, y, z, t_m) tmp = 0.0; if (y <= -6.5e-9) tmp = t_m; elseif (y <= 6.2e+40) tmp = x * (t_m / z); else tmp = t_m; end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -6.5e-9], t$95$m, If[LessEqual[y, 6.2e+40], N[(x * N[(t$95$m / z), $MachinePrecision]), $MachinePrecision], t$95$m]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{-9}:\\
\;\;\;\;t\_m\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+40}:\\
\;\;\;\;x \cdot \frac{t\_m}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_m\\
\end{array}
\end{array}
if y < -6.5000000000000003e-9 or 6.1999999999999995e40 < y Initial program 99.9%
associate-*l/72.9%
associate-/l*72.3%
Simplified72.3%
Taylor expanded in y around inf 54.9%
if -6.5000000000000003e-9 < y < 6.1999999999999995e40Initial program 92.3%
associate-*l/92.4%
associate-/l*92.1%
Simplified92.1%
Taylor expanded in x around inf 72.1%
Taylor expanded in z around inf 64.1%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x y z t_m) :precision binary64 (* t_s (/ t_m (/ (- z y) (- x y)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
return t_s * (t_m / ((z - y) / (x - y)));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
code = t_s * (t_m / ((z - y) / (x - y)))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
return t_s * (t_m / ((z - y) / (x - y)));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, y, z, t_m): return t_s * (t_m / ((z - y) / (x - y)))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, y, z, t_m) return Float64(t_s * Float64(t_m / Float64(Float64(z - y) / Float64(x - y)))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, x, y, z, t_m) tmp = t_s * (t_m / ((z - y) / (x - y))); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * N[(t$95$m / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \frac{t\_m}{\frac{z - y}{x - y}}
\end{array}
Initial program 96.1%
associate-*l/82.6%
associate-/l*82.1%
Simplified82.1%
associate-*r/82.6%
associate-*l/96.1%
*-commutative96.1%
clear-num96.1%
un-div-inv96.2%
Applied egg-rr96.2%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x y z t_m) :precision binary64 (* t_s (* t_m (/ (- x y) (- z y)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
return t_s * (t_m * ((x - y) / (z - y)));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
code = t_s * (t_m * ((x - y) / (z - y)))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
return t_s * (t_m * ((x - y) / (z - y)));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, y, z, t_m): return t_s * (t_m * ((x - y) / (z - y)))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, y, z, t_m) return Float64(t_s * Float64(t_m * Float64(Float64(x - y) / Float64(z - y)))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, x, y, z, t_m) tmp = t_s * (t_m * ((x - y) / (z - y))); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * N[(t$95$m * N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(t\_m \cdot \frac{x - y}{z - y}\right)
\end{array}
Initial program 96.1%
Final simplification96.1%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x y z t_m) :precision binary64 (* t_s t_m))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
return t_s * t_m;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
code = t_s * t_m
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
return t_s * t_m;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, y, z, t_m): return t_s * t_m
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, y, z, t_m) return Float64(t_s * t_m) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, x, y, z, t_m) tmp = t_s * t_m; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * t$95$m), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot t\_m
\end{array}
Initial program 96.1%
associate-*l/82.6%
associate-/l*82.1%
Simplified82.1%
Taylor expanded in y around inf 32.0%
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
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 = t / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
herbie shell --seed 2024165
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:alt
(! :herbie-platform default (/ t (/ (- z y) (- x y))))
(* (/ (- x y) (- z y)) t))