
(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 10 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 1 t) (FPCore (t_s x y z t_m) :precision binary64 (* t_s (if (<= t_m 1e-40) (* t_m (/ (- x y) (- z 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 <= 1e-40) {
tmp = t_m * ((x - y) / (z - 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 <= 1d-40) then
tmp = t_m * ((x - y) / (z - 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 <= 1e-40) {
tmp = t_m * ((x - y) / (z - 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 <= 1e-40: tmp = t_m * ((x - y) / (z - 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 <= 1e-40) tmp = Float64(t_m * Float64(Float64(x - y) / Float64(z - 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 <= 1e-40) tmp = t_m * ((x - y) / (z - 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, 1e-40], N[(t$95$m * N[(N[(x - y), $MachinePrecision] / N[(z - 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 10^{-40}:\\
\;\;\;\;t_m \cdot \frac{x - y}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y}{\frac{z - y}{t_m}}\\
\end{array}
\end{array}
if t < 9.9999999999999993e-41Initial program 95.4%
if 9.9999999999999993e-41 < t Initial program 95.7%
associate-/r/96.7%
Simplified96.7%
Final simplification95.8%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
:precision binary64
(*
t_s
(if (<= y -1.6e+119)
t_m
(if (<= y -3.6e+65)
(* t_m (/ (- y) z))
(if (<= y -3600000000.0)
t_m
(if (<= y 1.2e+62) (* x (/ t_m (- 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 (y <= -1.6e+119) {
tmp = t_m;
} else if (y <= -3.6e+65) {
tmp = t_m * (-y / z);
} else if (y <= -3600000000.0) {
tmp = t_m;
} else if (y <= 1.2e+62) {
tmp = x * (t_m / (z - y));
} 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 <= (-1.6d+119)) then
tmp = t_m
else if (y <= (-3.6d+65)) then
tmp = t_m * (-y / z)
else if (y <= (-3600000000.0d0)) then
tmp = t_m
else if (y <= 1.2d+62) then
tmp = x * (t_m / (z - y))
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 <= -1.6e+119) {
tmp = t_m;
} else if (y <= -3.6e+65) {
tmp = t_m * (-y / z);
} else if (y <= -3600000000.0) {
tmp = t_m;
} else if (y <= 1.2e+62) {
tmp = x * (t_m / (z - y));
} 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 <= -1.6e+119: tmp = t_m elif y <= -3.6e+65: tmp = t_m * (-y / z) elif y <= -3600000000.0: tmp = t_m elif y <= 1.2e+62: tmp = x * (t_m / (z - y)) 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 <= -1.6e+119) tmp = t_m; elseif (y <= -3.6e+65) tmp = Float64(t_m * Float64(Float64(-y) / z)); elseif (y <= -3600000000.0) tmp = t_m; elseif (y <= 1.2e+62) tmp = Float64(x * Float64(t_m / Float64(z - y))); 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 <= -1.6e+119) tmp = t_m; elseif (y <= -3.6e+65) tmp = t_m * (-y / z); elseif (y <= -3600000000.0) tmp = t_m; elseif (y <= 1.2e+62) tmp = x * (t_m / (z - y)); 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, -1.6e+119], t$95$m, If[LessEqual[y, -3.6e+65], N[(t$95$m * N[((-y) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3600000000.0], t$95$m, If[LessEqual[y, 1.2e+62], N[(x * N[(t$95$m / N[(z - y), $MachinePrecision]), $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 -1.6 \cdot 10^{+119}:\\
\;\;\;\;t_m\\
\mathbf{elif}\;y \leq -3.6 \cdot 10^{+65}:\\
\;\;\;\;t_m \cdot \frac{-y}{z}\\
\mathbf{elif}\;y \leq -3600000000:\\
\;\;\;\;t_m\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+62}:\\
\;\;\;\;x \cdot \frac{t_m}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t_m\\
\end{array}
\end{array}
if y < -1.59999999999999995e119 or -3.59999999999999978e65 < y < -3.6e9 or 1.2e62 < y Initial program 99.8%
Taylor expanded in y around inf 69.0%
if -1.59999999999999995e119 < y < -3.59999999999999978e65Initial program 99.6%
Taylor expanded in z around inf 74.8%
Taylor expanded in x around 0 60.6%
neg-mul-160.6%
distribute-neg-frac60.6%
Simplified60.6%
if -3.6e9 < y < 1.2e62Initial program 92.9%
Taylor expanded in x around inf 72.6%
*-commutative72.6%
associate-*r/72.9%
Simplified72.9%
Final simplification71.1%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
:precision binary64
(*
t_s
(if (<= y -7e+118)
t_m
(if (<= y -2.25e+66)
(* t_m (/ (- y) z))
(if (<= y -370000000.0) t_m (if (<= y 4e+62) (* 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 <= -7e+118) {
tmp = t_m;
} else if (y <= -2.25e+66) {
tmp = t_m * (-y / z);
} else if (y <= -370000000.0) {
tmp = t_m;
} else if (y <= 4e+62) {
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 <= (-7d+118)) then
tmp = t_m
else if (y <= (-2.25d+66)) then
tmp = t_m * (-y / z)
else if (y <= (-370000000.0d0)) then
tmp = t_m
else if (y <= 4d+62) 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 <= -7e+118) {
tmp = t_m;
} else if (y <= -2.25e+66) {
tmp = t_m * (-y / z);
} else if (y <= -370000000.0) {
tmp = t_m;
} else if (y <= 4e+62) {
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 <= -7e+118: tmp = t_m elif y <= -2.25e+66: tmp = t_m * (-y / z) elif y <= -370000000.0: tmp = t_m elif y <= 4e+62: 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 <= -7e+118) tmp = t_m; elseif (y <= -2.25e+66) tmp = Float64(t_m * Float64(Float64(-y) / z)); elseif (y <= -370000000.0) tmp = t_m; elseif (y <= 4e+62) 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 <= -7e+118) tmp = t_m; elseif (y <= -2.25e+66) tmp = t_m * (-y / z); elseif (y <= -370000000.0) tmp = t_m; elseif (y <= 4e+62) 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, -7e+118], t$95$m, If[LessEqual[y, -2.25e+66], N[(t$95$m * N[((-y) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -370000000.0], t$95$m, If[LessEqual[y, 4e+62], 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 -7 \cdot 10^{+118}:\\
\;\;\;\;t_m\\
\mathbf{elif}\;y \leq -2.25 \cdot 10^{+66}:\\
\;\;\;\;t_m \cdot \frac{-y}{z}\\
\mathbf{elif}\;y \leq -370000000:\\
\;\;\;\;t_m\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+62}:\\
\;\;\;\;x \cdot \frac{t_m}{z}\\
\mathbf{else}:\\
\;\;\;\;t_m\\
\end{array}
\end{array}
if y < -7.00000000000000033e118 or -2.2499999999999999e66 < y < -3.7e8 or 4.00000000000000014e62 < y Initial program 99.8%
Taylor expanded in y around inf 68.3%
if -7.00000000000000033e118 < y < -2.2499999999999999e66Initial program 99.6%
Taylor expanded in z around inf 74.8%
Taylor expanded in x around 0 60.6%
neg-mul-160.6%
distribute-neg-frac60.6%
Simplified60.6%
if -3.7e8 < y < 4.00000000000000014e62Initial program 92.9%
Taylor expanded in y around 0 61.4%
associate-/l*59.9%
associate-/r/61.8%
Simplified61.8%
Final simplification64.0%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
:precision binary64
(*
t_s
(if (or (<= y -3.8e-47) (not (<= y 6.2e+62)))
(* 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 <= -3.8e-47) || !(y <= 6.2e+62)) {
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 <= (-3.8d-47)) .or. (.not. (y <= 6.2d+62))) 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 <= -3.8e-47) || !(y <= 6.2e+62)) {
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 <= -3.8e-47) or not (y <= 6.2e+62): 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 <= -3.8e-47) || !(y <= 6.2e+62)) 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 <= -3.8e-47) || ~((y <= 6.2e+62))) 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, -3.8e-47], N[Not[LessEqual[y, 6.2e+62]], $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 -3.8 \cdot 10^{-47} \lor \neg \left(y \leq 6.2 \cdot 10^{+62}\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 < -3.80000000000000015e-47 or 6.20000000000000029e62 < y Initial program 99.8%
Taylor expanded in z around 0 77.0%
associate-*r/77.0%
neg-mul-177.0%
Simplified77.0%
Taylor expanded in x around 0 77.0%
mul-1-neg77.0%
unsub-neg77.0%
Simplified77.0%
if -3.80000000000000015e-47 < y < 6.20000000000000029e62Initial program 92.2%
Taylor expanded in x around inf 73.6%
*-commutative73.6%
associate-*r/73.9%
Simplified73.9%
Final simplification75.3%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
:precision binary64
(*
t_s
(if (or (<= y -5.2e-61) (not (<= y 5.7e+32)))
(* 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 <= -5.2e-61) || !(y <= 5.7e+32)) {
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 <= (-5.2d-61)) .or. (.not. (y <= 5.7d+32))) 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 <= -5.2e-61) || !(y <= 5.7e+32)) {
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 <= -5.2e-61) or not (y <= 5.7e+32): 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 <= -5.2e-61) || !(y <= 5.7e+32)) 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 <= -5.2e-61) || ~((y <= 5.7e+32))) 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, -5.2e-61], N[Not[LessEqual[y, 5.7e+32]], $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 -5.2 \cdot 10^{-61} \lor \neg \left(y \leq 5.7 \cdot 10^{+32}\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 < -5.20000000000000021e-61 or 5.7e32 < y Initial program 99.8%
Taylor expanded in z around 0 75.8%
associate-*r/75.8%
neg-mul-175.8%
Simplified75.8%
Taylor expanded in x around 0 75.7%
mul-1-neg75.7%
unsub-neg75.7%
Simplified75.7%
if -5.20000000000000021e-61 < y < 5.7e32Initial program 91.7%
associate-/r/95.4%
div-inv95.4%
associate-/r*91.6%
Applied egg-rr91.6%
Taylor expanded in z around inf 80.9%
associate-*l/81.3%
Simplified81.3%
Final simplification78.6%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
:precision binary64
(*
t_s
(if (or (<= z -9.5e-21) (not (<= z 4.5e+36)))
(* t_m (/ (- x y) z))
(* t_m (- 1.0 (/ 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) {
double tmp;
if ((z <= -9.5e-21) || !(z <= 4.5e+36)) {
tmp = t_m * ((x - y) / z);
} else {
tmp = t_m * (1.0 - (x / 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 ((z <= (-9.5d-21)) .or. (.not. (z <= 4.5d+36))) then
tmp = t_m * ((x - y) / z)
else
tmp = t_m * (1.0d0 - (x / 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 ((z <= -9.5e-21) || !(z <= 4.5e+36)) {
tmp = t_m * ((x - y) / z);
} else {
tmp = t_m * (1.0 - (x / 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 (z <= -9.5e-21) or not (z <= 4.5e+36): tmp = t_m * ((x - y) / z) else: tmp = t_m * (1.0 - (x / 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 ((z <= -9.5e-21) || !(z <= 4.5e+36)) tmp = Float64(t_m * Float64(Float64(x - y) / z)); else tmp = Float64(t_m * Float64(1.0 - Float64(x / 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 ((z <= -9.5e-21) || ~((z <= 4.5e+36))) tmp = t_m * ((x - y) / z); else tmp = t_m * (1.0 - (x / 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[z, -9.5e-21], N[Not[LessEqual[z, 4.5e+36]], $MachinePrecision]], N[(t$95$m * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(t$95$m * N[(1.0 - 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 \begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-21} \lor \neg \left(z \leq 4.5 \cdot 10^{+36}\right):\\
\;\;\;\;t_m \cdot \frac{x - y}{z}\\
\mathbf{else}:\\
\;\;\;\;t_m \cdot \left(1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
if z < -9.4999999999999994e-21 or 4.49999999999999997e36 < z Initial program 94.9%
Taylor expanded in z around inf 81.3%
if -9.4999999999999994e-21 < z < 4.49999999999999997e36Initial program 96.2%
Taylor expanded in z around 0 78.7%
associate-*r/78.7%
neg-mul-178.7%
Simplified78.7%
Taylor expanded in x around 0 78.7%
mul-1-neg78.7%
unsub-neg78.7%
Simplified78.7%
Final simplification80.1%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
:precision binary64
(*
t_s
(if (or (<= z -3.2e-21) (not (<= z 7.5e+37)))
(* t_m (/ (- x y) z))
(/ t_m (/ y (- y x))))))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 ((z <= -3.2e-21) || !(z <= 7.5e+37)) {
tmp = t_m * ((x - y) / z);
} else {
tmp = t_m / (y / (y - x));
}
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 ((z <= (-3.2d-21)) .or. (.not. (z <= 7.5d+37))) then
tmp = t_m * ((x - y) / z)
else
tmp = t_m / (y / (y - x))
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 ((z <= -3.2e-21) || !(z <= 7.5e+37)) {
tmp = t_m * ((x - y) / z);
} else {
tmp = t_m / (y / (y - x));
}
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 (z <= -3.2e-21) or not (z <= 7.5e+37): tmp = t_m * ((x - y) / z) else: tmp = t_m / (y / (y - x)) 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 ((z <= -3.2e-21) || !(z <= 7.5e+37)) tmp = Float64(t_m * Float64(Float64(x - y) / z)); else tmp = Float64(t_m / Float64(y / Float64(y - x))); 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 ((z <= -3.2e-21) || ~((z <= 7.5e+37))) tmp = t_m * ((x - y) / z); else tmp = t_m / (y / (y - x)); 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[z, -3.2e-21], N[Not[LessEqual[z, 7.5e+37]], $MachinePrecision]], N[(t$95$m * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(t$95$m / N[(y / N[(y - x), $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}\;z \leq -3.2 \cdot 10^{-21} \lor \neg \left(z \leq 7.5 \cdot 10^{+37}\right):\\
\;\;\;\;t_m \cdot \frac{x - y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_m}{\frac{y}{y - x}}\\
\end{array}
\end{array}
if z < -3.2000000000000002e-21 or 7.5000000000000003e37 < z Initial program 94.9%
Taylor expanded in z around inf 81.3%
if -3.2000000000000002e-21 < z < 7.5000000000000003e37Initial program 96.2%
Taylor expanded in z around 0 78.7%
associate-*r/78.7%
neg-mul-178.7%
Simplified78.7%
Taylor expanded in t around 0 64.9%
associate-/l*78.7%
Simplified78.7%
Final simplification80.1%
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s x y z t_m) :precision binary64 (* t_s (if (<= y -2050000000.0) t_m (if (<= y 4.8e+62) (* 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 <= -2050000000.0) {
tmp = t_m;
} else if (y <= 4.8e+62) {
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 <= (-2050000000.0d0)) then
tmp = t_m
else if (y <= 4.8d+62) 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 <= -2050000000.0) {
tmp = t_m;
} else if (y <= 4.8e+62) {
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 <= -2050000000.0: tmp = t_m elif y <= 4.8e+62: 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 <= -2050000000.0) tmp = t_m; elseif (y <= 4.8e+62) 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 <= -2050000000.0) tmp = t_m; elseif (y <= 4.8e+62) 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, -2050000000.0], t$95$m, If[LessEqual[y, 4.8e+62], 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 -2050000000:\\
\;\;\;\;t_m\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+62}:\\
\;\;\;\;x \cdot \frac{t_m}{z}\\
\mathbf{else}:\\
\;\;\;\;t_m\\
\end{array}
\end{array}
if y < -2.05e9 or 4.8e62 < y Initial program 99.8%
Taylor expanded in y around inf 63.0%
if -2.05e9 < y < 4.8e62Initial program 92.9%
Taylor expanded in y around 0 61.4%
associate-/l*59.9%
associate-/r/61.8%
Simplified61.8%
Final simplification62.2%
t_m = (fabs.f64 t) t_s = (copysign.f64 1 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 95.5%
Final simplification95.5%
t_m = (fabs.f64 t) t_s = (copysign.f64 1 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 95.5%
Taylor expanded in y around inf 31.7%
Final simplification31.7%
(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 2024020
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(/ t (/ (- z y) (- x y)))
(* (/ (- x y) (- z y)) t))