
(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(x / Float64(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[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 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(x / Float64(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[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\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 (let* ((t_1 (/ x_m (* (- y z) (- t z))))) (* x_s (if (<= t_1 0.0) (/ (/ x_m (- t z)) (- y z)) t_1))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / ((y - z) * (t - z));
double tmp;
if (t_1 <= 0.0) {
tmp = (x_m / (t - z)) / (y - z);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x_m / ((y - z) * (t - z))
if (t_1 <= 0.0d0) then
tmp = (x_m / (t - z)) / (y - z)
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / ((y - z) * (t - z));
double tmp;
if (t_1 <= 0.0) {
tmp = (x_m / (t - z)) / (y - z);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = x_m / ((y - z) * (t - z)) tmp = 0 if t_1 <= 0.0: tmp = (x_m / (t - z)) / (y - z) else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(Float64(x_m / Float64(t - z)) / Float64(y - z)); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = x_m / ((y - z) * (t - z)); tmp = 0.0; if (t_1 <= 0.0) tmp = (x_m / (t - z)) / (y - z); else tmp = t_1; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, 0.0], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], t$95$1]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := \frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -0.0Initial program 88.5%
associate-/l/96.9%
Simplified96.9%
if -0.0 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 98.2%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -3.3e+274)
(/ (/ x_m y) t)
(if (<= y -3.9e+55)
(/ x_m (* y (- z)))
(if (<= y -1.18e-150)
(/ (/ x_m t) y)
(if (<= y 7.5e-103) (/ (/ x_m t) (- z)) (/ x_m (* y 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 <= -3.3e+274) {
tmp = (x_m / y) / t;
} else if (y <= -3.9e+55) {
tmp = x_m / (y * -z);
} else if (y <= -1.18e-150) {
tmp = (x_m / t) / y;
} else if (y <= 7.5e-103) {
tmp = (x_m / t) / -z;
} else {
tmp = x_m / (y * 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 <= (-3.3d+274)) then
tmp = (x_m / y) / t
else if (y <= (-3.9d+55)) then
tmp = x_m / (y * -z)
else if (y <= (-1.18d-150)) then
tmp = (x_m / t) / y
else if (y <= 7.5d-103) then
tmp = (x_m / t) / -z
else
tmp = x_m / (y * 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 <= -3.3e+274) {
tmp = (x_m / y) / t;
} else if (y <= -3.9e+55) {
tmp = x_m / (y * -z);
} else if (y <= -1.18e-150) {
tmp = (x_m / t) / y;
} else if (y <= 7.5e-103) {
tmp = (x_m / t) / -z;
} else {
tmp = x_m / (y * 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 <= -3.3e+274: tmp = (x_m / y) / t elif y <= -3.9e+55: tmp = x_m / (y * -z) elif y <= -1.18e-150: tmp = (x_m / t) / y elif y <= 7.5e-103: tmp = (x_m / t) / -z else: tmp = x_m / (y * 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 <= -3.3e+274) tmp = Float64(Float64(x_m / y) / t); elseif (y <= -3.9e+55) tmp = Float64(x_m / Float64(y * Float64(-z))); elseif (y <= -1.18e-150) tmp = Float64(Float64(x_m / t) / y); elseif (y <= 7.5e-103) tmp = Float64(Float64(x_m / t) / Float64(-z)); else tmp = Float64(x_m / Float64(y * 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 <= -3.3e+274) tmp = (x_m / y) / t; elseif (y <= -3.9e+55) tmp = x_m / (y * -z); elseif (y <= -1.18e-150) tmp = (x_m / t) / y; elseif (y <= 7.5e-103) tmp = (x_m / t) / -z; else tmp = x_m / (y * 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[y, -3.3e+274], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, -3.9e+55], N[(x$95$m / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.18e-150], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 7.5e-103], N[(N[(x$95$m / t), $MachinePrecision] / (-z)), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{+274}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;y \leq -3.9 \cdot 10^{+55}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(-z\right)}\\
\mathbf{elif}\;y \leq -1.18 \cdot 10^{-150}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-103}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{-z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if y < -3.30000000000000014e274Initial program 86.3%
associate-/l/86.2%
div-inv86.2%
Applied egg-rr86.2%
associate-*l/99.3%
div-inv99.3%
div-inv99.3%
clear-num99.3%
associate-*l/99.6%
*-un-lft-identity99.6%
Applied egg-rr99.6%
Taylor expanded in z around 0 58.7%
*-lft-identity58.7%
times-frac71.8%
associate-*l/71.8%
*-lft-identity71.8%
Simplified71.8%
if -3.30000000000000014e274 < y < -3.90000000000000027e55Initial program 84.9%
Taylor expanded in x around 0 84.9%
associate-/l/94.2%
Simplified94.2%
Taylor expanded in y around inf 83.5%
Taylor expanded in t around 0 51.7%
mul-1-neg51.7%
distribute-neg-frac251.7%
*-commutative51.7%
Simplified51.7%
if -3.90000000000000027e55 < y < -1.18e-150Initial program 92.1%
associate-/l/99.7%
div-inv99.6%
Applied egg-rr99.6%
associate-*l/97.0%
div-inv97.1%
div-inv97.0%
clear-num97.0%
associate-*l/97.0%
*-un-lft-identity97.0%
Applied egg-rr97.0%
Taylor expanded in z around 0 40.7%
associate-/r*43.4%
Simplified43.4%
if -1.18e-150 < y < 7.5e-103Initial program 97.1%
Taylor expanded in y around 0 81.8%
associate-*r/81.8%
neg-mul-181.8%
Simplified81.8%
Taylor expanded in z around 0 49.1%
mul-1-neg49.1%
associate-/r*49.1%
distribute-frac-neg249.1%
Simplified49.1%
if 7.5e-103 < y Initial program 89.9%
Taylor expanded in z around 0 47.7%
Final simplification48.9%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -2.3e+278)
(/ (/ x_m y) t)
(if (<= y -1.45e+50)
(/ x_m (* y (- z)))
(if (<= y -1.55e-149)
(/ (/ x_m t) y)
(if (<= y 5.8e-108) (/ (- x_m) (* z t)) (/ x_m (* y t))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -2.3e+278) {
tmp = (x_m / y) / t;
} else if (y <= -1.45e+50) {
tmp = x_m / (y * -z);
} else if (y <= -1.55e-149) {
tmp = (x_m / t) / y;
} else if (y <= 5.8e-108) {
tmp = -x_m / (z * t);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.3d+278)) then
tmp = (x_m / y) / t
else if (y <= (-1.45d+50)) then
tmp = x_m / (y * -z)
else if (y <= (-1.55d-149)) then
tmp = (x_m / t) / y
else if (y <= 5.8d-108) then
tmp = -x_m / (z * t)
else
tmp = x_m / (y * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -2.3e+278) {
tmp = (x_m / y) / t;
} else if (y <= -1.45e+50) {
tmp = x_m / (y * -z);
} else if (y <= -1.55e-149) {
tmp = (x_m / t) / y;
} else if (y <= 5.8e-108) {
tmp = -x_m / (z * t);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -2.3e+278: tmp = (x_m / y) / t elif y <= -1.45e+50: tmp = x_m / (y * -z) elif y <= -1.55e-149: tmp = (x_m / t) / y elif y <= 5.8e-108: tmp = -x_m / (z * t) else: tmp = x_m / (y * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -2.3e+278) tmp = Float64(Float64(x_m / y) / t); elseif (y <= -1.45e+50) tmp = Float64(x_m / Float64(y * Float64(-z))); elseif (y <= -1.55e-149) tmp = Float64(Float64(x_m / t) / y); elseif (y <= 5.8e-108) tmp = Float64(Float64(-x_m) / Float64(z * t)); else tmp = Float64(x_m / Float64(y * t)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (y <= -2.3e+278) tmp = (x_m / y) / t; elseif (y <= -1.45e+50) tmp = x_m / (y * -z); elseif (y <= -1.55e-149) tmp = (x_m / t) / y; elseif (y <= 5.8e-108) tmp = -x_m / (z * t); else tmp = x_m / (y * 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[y, -2.3e+278], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, -1.45e+50], N[(x$95$m / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.55e-149], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 5.8e-108], N[((-x$95$m) / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+278}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{+50}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(-z\right)}\\
\mathbf{elif}\;y \leq -1.55 \cdot 10^{-149}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-108}:\\
\;\;\;\;\frac{-x\_m}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if y < -2.2999999999999999e278Initial program 86.3%
associate-/l/86.2%
div-inv86.2%
Applied egg-rr86.2%
associate-*l/99.3%
div-inv99.3%
div-inv99.3%
clear-num99.3%
associate-*l/99.6%
*-un-lft-identity99.6%
Applied egg-rr99.6%
Taylor expanded in z around 0 58.7%
*-lft-identity58.7%
times-frac71.8%
associate-*l/71.8%
*-lft-identity71.8%
Simplified71.8%
if -2.2999999999999999e278 < y < -1.45e50Initial program 84.9%
Taylor expanded in x around 0 84.9%
associate-/l/94.2%
Simplified94.2%
Taylor expanded in y around inf 83.5%
Taylor expanded in t around 0 51.7%
mul-1-neg51.7%
distribute-neg-frac251.7%
*-commutative51.7%
Simplified51.7%
if -1.45e50 < y < -1.54999999999999994e-149Initial program 92.1%
associate-/l/99.7%
div-inv99.6%
Applied egg-rr99.6%
associate-*l/97.0%
div-inv97.1%
div-inv97.0%
clear-num97.0%
associate-*l/97.0%
*-un-lft-identity97.0%
Applied egg-rr97.0%
Taylor expanded in z around 0 40.7%
associate-/r*43.4%
Simplified43.4%
if -1.54999999999999994e-149 < y < 5.8000000000000002e-108Initial program 97.0%
associate-/l/95.7%
Simplified95.7%
Taylor expanded in t around inf 59.7%
Taylor expanded in y around 0 49.8%
associate-*r/49.8%
neg-mul-149.8%
Simplified49.8%
if 5.8000000000000002e-108 < y Initial program 90.0%
Taylor expanded in z around 0 47.2%
Final simplification48.9%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -4e+116) (not (<= z 9.5e+172)))
(/ (/ x_m z) (- z y))
(/ 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) {
double tmp;
if ((z <= -4e+116) || !(z <= 9.5e+172)) {
tmp = (x_m / z) / (z - y);
} else {
tmp = x_m / ((y - z) * (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 <= (-4d+116)) .or. (.not. (z <= 9.5d+172))) then
tmp = (x_m / z) / (z - y)
else
tmp = x_m / ((y - z) * (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 <= -4e+116) || !(z <= 9.5e+172)) {
tmp = (x_m / z) / (z - y);
} else {
tmp = x_m / ((y - z) * (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 <= -4e+116) or not (z <= 9.5e+172): tmp = (x_m / z) / (z - y) else: tmp = x_m / ((y - z) * (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 <= -4e+116) || !(z <= 9.5e+172)) tmp = Float64(Float64(x_m / z) / Float64(z - y)); else tmp = Float64(x_m / Float64(Float64(y - z) * 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 <= -4e+116) || ~((z <= 9.5e+172))) tmp = (x_m / z) / (z - y); else tmp = x_m / ((y - z) * (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, -4e+116], N[Not[LessEqual[z, 9.5e+172]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+116} \lor \neg \left(z \leq 9.5 \cdot 10^{+172}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\end{array}
\end{array}
if z < -4.00000000000000006e116 or 9.50000000000000027e172 < z Initial program 78.0%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 95.7%
associate-*r/95.7%
neg-mul-195.7%
Simplified95.7%
if -4.00000000000000006e116 < z < 9.50000000000000027e172Initial program 96.0%
Final simplification95.9%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= z -1.6e+117)
(/ (/ -1.0 z) (/ (- y z) x_m))
(if (<= z 9.5e+172) (/ x_m (* (- y z) (- t z))) (/ (/ x_m z) (- 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 (z <= -1.6e+117) {
tmp = (-1.0 / z) / ((y - z) / x_m);
} else if (z <= 9.5e+172) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (x_m / z) / (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 (z <= (-1.6d+117)) then
tmp = ((-1.0d0) / z) / ((y - z) / x_m)
else if (z <= 9.5d+172) then
tmp = x_m / ((y - z) * (t - z))
else
tmp = (x_m / z) / (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 (z <= -1.6e+117) {
tmp = (-1.0 / z) / ((y - z) / x_m);
} else if (z <= 9.5e+172) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (x_m / z) / (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 z <= -1.6e+117: tmp = (-1.0 / z) / ((y - z) / x_m) elif z <= 9.5e+172: tmp = x_m / ((y - z) * (t - z)) else: tmp = (x_m / z) / (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 (z <= -1.6e+117) tmp = Float64(Float64(-1.0 / z) / Float64(Float64(y - z) / x_m)); elseif (z <= 9.5e+172) tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(Float64(x_m / z) / 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 (z <= -1.6e+117) tmp = (-1.0 / z) / ((y - z) / x_m); elseif (z <= 9.5e+172) tmp = x_m / ((y - z) * (t - z)); else tmp = (x_m / z) / (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[z, -1.6e+117], N[(N[(-1.0 / z), $MachinePrecision] / N[(N[(y - z), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+172], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / z), $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}\;z \leq -1.6 \cdot 10^{+117}:\\
\;\;\;\;\frac{\frac{-1}{z}}{\frac{y - z}{x\_m}}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+172}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\end{array}
\end{array}
if z < -1.60000000000000002e117Initial program 76.2%
associate-/l/99.8%
div-inv99.7%
Applied egg-rr99.7%
associate-*l/99.7%
div-inv99.8%
div-inv99.7%
clear-num99.7%
associate-*l/99.8%
*-un-lft-identity99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 92.9%
if -1.60000000000000002e117 < z < 9.50000000000000027e172Initial program 96.0%
if 9.50000000000000027e172 < z Initial program 80.5%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around 0 99.9%
associate-*r/99.9%
neg-mul-199.9%
Simplified99.9%
Final simplification95.9%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= z -4.2e-33)
(/ (/ x_m z) (- z y))
(if (<= z 2.2e-65) (/ x_m (* (- y z) t)) (* (/ x_m (- t z)) (/ -1.0 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 <= -4.2e-33) {
tmp = (x_m / z) / (z - y);
} else if (z <= 2.2e-65) {
tmp = x_m / ((y - z) * t);
} else {
tmp = (x_m / (t - z)) * (-1.0 / 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 <= (-4.2d-33)) then
tmp = (x_m / z) / (z - y)
else if (z <= 2.2d-65) then
tmp = x_m / ((y - z) * t)
else
tmp = (x_m / (t - z)) * ((-1.0d0) / 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 <= -4.2e-33) {
tmp = (x_m / z) / (z - y);
} else if (z <= 2.2e-65) {
tmp = x_m / ((y - z) * t);
} else {
tmp = (x_m / (t - z)) * (-1.0 / 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 <= -4.2e-33: tmp = (x_m / z) / (z - y) elif z <= 2.2e-65: tmp = x_m / ((y - z) * t) else: tmp = (x_m / (t - z)) * (-1.0 / 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 <= -4.2e-33) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (z <= 2.2e-65) tmp = Float64(x_m / Float64(Float64(y - z) * t)); else tmp = Float64(Float64(x_m / Float64(t - z)) * Float64(-1.0 / 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 <= -4.2e-33) tmp = (x_m / z) / (z - y); elseif (z <= 2.2e-65) tmp = x_m / ((y - z) * t); else tmp = (x_m / (t - z)) * (-1.0 / z); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -4.2e-33], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e-65], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / z), $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 -4.2 \cdot 10^{-33}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-65}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{t - z} \cdot \frac{-1}{z}\\
\end{array}
\end{array}
if z < -4.2e-33Initial program 86.1%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around 0 85.7%
associate-*r/85.7%
neg-mul-185.7%
Simplified85.7%
if -4.2e-33 < z < 2.20000000000000021e-65Initial program 98.7%
Taylor expanded in t around inf 81.2%
if 2.20000000000000021e-65 < z Initial program 85.9%
associate-/l/99.8%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 81.3%
Final simplification82.6%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= t -3.2e-178) (not (<= t 4.2e-109)))
(/ x_m (* (- y z) t))
(/ x_m (* y (- z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((t <= -3.2e-178) || !(t <= 4.2e-109)) {
tmp = x_m / ((y - z) * t);
} else {
tmp = x_m / (y * -z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-3.2d-178)) .or. (.not. (t <= 4.2d-109))) then
tmp = x_m / ((y - z) * t)
else
tmp = x_m / (y * -z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((t <= -3.2e-178) || !(t <= 4.2e-109)) {
tmp = x_m / ((y - z) * t);
} else {
tmp = x_m / (y * -z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if (t <= -3.2e-178) or not (t <= 4.2e-109): tmp = x_m / ((y - z) * t) else: tmp = x_m / (y * -z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((t <= -3.2e-178) || !(t <= 4.2e-109)) tmp = Float64(x_m / Float64(Float64(y - z) * t)); else tmp = Float64(x_m / Float64(y * Float64(-z))); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if ((t <= -3.2e-178) || ~((t <= 4.2e-109))) tmp = x_m / ((y - z) * t); else tmp = x_m / (y * -z); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[t, -3.2e-178], N[Not[LessEqual[t, 4.2e-109]], $MachinePrecision]], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * (-z)), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{-178} \lor \neg \left(t \leq 4.2 \cdot 10^{-109}\right):\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(-z\right)}\\
\end{array}
\end{array}
if t < -3.2000000000000001e-178 or 4.19999999999999992e-109 < t Initial program 90.9%
Taylor expanded in t around inf 72.9%
if -3.2000000000000001e-178 < t < 4.19999999999999992e-109Initial program 91.6%
Taylor expanded in x around 0 91.6%
associate-/l/94.6%
Simplified94.6%
Taylor expanded in y around inf 60.1%
Taylor expanded in t around 0 49.5%
mul-1-neg49.5%
distribute-neg-frac249.5%
*-commutative49.5%
Simplified49.5%
Final simplification66.4%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -1.26e-191)
(/ (/ x_m y) (- t z))
(if (<= t 6e-28) (/ (/ x_m z) (- z y)) (/ x_m (* (- y z) t))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -1.26e-191) {
tmp = (x_m / y) / (t - z);
} else if (t <= 6e-28) {
tmp = (x_m / z) / (z - y);
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.26d-191)) then
tmp = (x_m / y) / (t - z)
else if (t <= 6d-28) then
tmp = (x_m / z) / (z - y)
else
tmp = x_m / ((y - z) * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -1.26e-191) {
tmp = (x_m / y) / (t - z);
} else if (t <= 6e-28) {
tmp = (x_m / z) / (z - y);
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if t <= -1.26e-191: tmp = (x_m / y) / (t - z) elif t <= 6e-28: tmp = (x_m / z) / (z - y) else: tmp = x_m / ((y - z) * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= -1.26e-191) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (t <= 6e-28) tmp = Float64(Float64(x_m / z) / Float64(z - y)); else tmp = Float64(x_m / Float64(Float64(y - z) * t)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (t <= -1.26e-191) tmp = (x_m / y) / (t - z); elseif (t <= 6e-28) tmp = (x_m / z) / (z - y); else tmp = x_m / ((y - z) * t); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -1.26e-191], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e-28], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.26 \cdot 10^{-191}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-28}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -1.26e-191Initial program 87.5%
Taylor expanded in x around 0 87.5%
associate-/l/98.8%
Simplified98.8%
Taylor expanded in y around inf 61.6%
if -1.26e-191 < t < 6.00000000000000005e-28Initial program 93.1%
associate-/l/97.6%
Simplified97.6%
Taylor expanded in t around 0 81.0%
associate-*r/81.0%
neg-mul-181.0%
Simplified81.0%
if 6.00000000000000005e-28 < t Initial program 94.0%
Taylor expanded in t around inf 91.2%
Final simplification75.9%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t 2.3e-225)
(/ (/ x_m y) (- t z))
(if (<= t 48000.0) (/ x_m (* z (- z t))) (/ x_m (* (- y z) t))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 2.3e-225) {
tmp = (x_m / y) / (t - z);
} else if (t <= 48000.0) {
tmp = x_m / (z * (z - t));
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 2.3d-225) then
tmp = (x_m / y) / (t - z)
else if (t <= 48000.0d0) then
tmp = x_m / (z * (z - t))
else
tmp = x_m / ((y - z) * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 2.3e-225) {
tmp = (x_m / y) / (t - z);
} else if (t <= 48000.0) {
tmp = x_m / (z * (z - t));
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if t <= 2.3e-225: tmp = (x_m / y) / (t - z) elif t <= 48000.0: tmp = x_m / (z * (z - t)) else: tmp = x_m / ((y - z) * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= 2.3e-225) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (t <= 48000.0) tmp = Float64(x_m / Float64(z * Float64(z - t))); else tmp = Float64(x_m / Float64(Float64(y - z) * t)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (t <= 2.3e-225) tmp = (x_m / y) / (t - z); elseif (t <= 48000.0) tmp = x_m / (z * (z - t)); else tmp = x_m / ((y - z) * t); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, 2.3e-225], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 48000.0], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq 2.3 \cdot 10^{-225}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;t \leq 48000:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < 2.2999999999999999e-225Initial program 88.7%
Taylor expanded in x around 0 88.7%
associate-/l/97.8%
Simplified97.8%
Taylor expanded in y around inf 60.9%
if 2.2999999999999999e-225 < t < 48000Initial program 94.0%
Taylor expanded in y around 0 64.6%
associate-*r/64.6%
neg-mul-164.6%
Simplified64.6%
if 48000 < t Initial program 93.8%
Taylor expanded in t around inf 90.9%
Final simplification69.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 (or (<= z -3.8e-87) (not (<= z 1.12e-88)))
(/ (/ x_m (- z)) t)
(/ x_m (* y 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 <= -3.8e-87) || !(z <= 1.12e-88)) {
tmp = (x_m / -z) / t;
} else {
tmp = x_m / (y * 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 <= (-3.8d-87)) .or. (.not. (z <= 1.12d-88))) then
tmp = (x_m / -z) / t
else
tmp = x_m / (y * 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 <= -3.8e-87) || !(z <= 1.12e-88)) {
tmp = (x_m / -z) / t;
} else {
tmp = x_m / (y * 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 <= -3.8e-87) or not (z <= 1.12e-88): tmp = (x_m / -z) / t else: tmp = x_m / (y * 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 <= -3.8e-87) || !(z <= 1.12e-88)) tmp = Float64(Float64(x_m / Float64(-z)) / t); else tmp = Float64(x_m / Float64(y * 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 <= -3.8e-87) || ~((z <= 1.12e-88))) tmp = (x_m / -z) / t; else tmp = x_m / (y * 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[z, -3.8e-87], N[Not[LessEqual[z, 1.12e-88]], $MachinePrecision]], N[(N[(x$95$m / (-z)), $MachinePrecision] / t), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{-87} \lor \neg \left(z \leq 1.12 \cdot 10^{-88}\right):\\
\;\;\;\;\frac{\frac{x\_m}{-z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -3.8e-87 or 1.12e-88 < z Initial program 87.3%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around inf 46.7%
Taylor expanded in y around 0 38.2%
associate-*r/38.2%
neg-mul-138.2%
Simplified38.2%
Taylor expanded in x around 0 38.2%
mul-1-neg38.2%
associate-/l/44.8%
distribute-neg-frac244.8%
Simplified44.8%
if -3.8e-87 < z < 1.12e-88Initial program 98.5%
Taylor expanded in z around 0 70.7%
Final simplification53.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 (or (<= z -300000000000.0) (not (<= z 1e-91)))
(/ x_m (* y (- z)))
(/ x_m (* y 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 <= -300000000000.0) || !(z <= 1e-91)) {
tmp = x_m / (y * -z);
} else {
tmp = x_m / (y * 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 <= (-300000000000.0d0)) .or. (.not. (z <= 1d-91))) then
tmp = x_m / (y * -z)
else
tmp = x_m / (y * 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 <= -300000000000.0) || !(z <= 1e-91)) {
tmp = x_m / (y * -z);
} else {
tmp = x_m / (y * 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 <= -300000000000.0) or not (z <= 1e-91): tmp = x_m / (y * -z) else: tmp = x_m / (y * 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 <= -300000000000.0) || !(z <= 1e-91)) tmp = Float64(x_m / Float64(y * Float64(-z))); else tmp = Float64(x_m / Float64(y * 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 <= -300000000000.0) || ~((z <= 1e-91))) tmp = x_m / (y * -z); else tmp = x_m / (y * 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[z, -300000000000.0], N[Not[LessEqual[z, 1e-91]], $MachinePrecision]], N[(x$95$m / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -300000000000 \lor \neg \left(z \leq 10^{-91}\right):\\
\;\;\;\;\frac{x\_m}{y \cdot \left(-z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -3e11 or 1.00000000000000002e-91 < z Initial program 85.7%
Taylor expanded in x around 0 85.7%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in y around inf 49.4%
Taylor expanded in t around 0 41.9%
mul-1-neg41.9%
distribute-neg-frac241.9%
*-commutative41.9%
Simplified41.9%
if -3e11 < z < 1.00000000000000002e-91Initial program 98.8%
Taylor expanded in z around 0 63.1%
Final simplification50.6%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= z -1.3e-87)
(* (/ -1.0 t) (/ x_m z))
(if (<= z 1.15e-88) (/ x_m (* y t)) (/ (/ x_m (- z)) t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -1.3e-87) {
tmp = (-1.0 / t) * (x_m / z);
} else if (z <= 1.15e-88) {
tmp = x_m / (y * t);
} else {
tmp = (x_m / -z) / t;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.3d-87)) then
tmp = ((-1.0d0) / t) * (x_m / z)
else if (z <= 1.15d-88) then
tmp = x_m / (y * t)
else
tmp = (x_m / -z) / t
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -1.3e-87) {
tmp = (-1.0 / t) * (x_m / z);
} else if (z <= 1.15e-88) {
tmp = x_m / (y * t);
} else {
tmp = (x_m / -z) / t;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if z <= -1.3e-87: tmp = (-1.0 / t) * (x_m / z) elif z <= 1.15e-88: tmp = x_m / (y * t) else: tmp = (x_m / -z) / t return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -1.3e-87) tmp = Float64(Float64(-1.0 / t) * Float64(x_m / z)); elseif (z <= 1.15e-88) tmp = Float64(x_m / Float64(y * t)); else tmp = Float64(Float64(x_m / Float64(-z)) / t); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (z <= -1.3e-87) tmp = (-1.0 / t) * (x_m / z); elseif (z <= 1.15e-88) tmp = x_m / (y * t); else tmp = (x_m / -z) / t; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -1.3e-87], N[(N[(-1.0 / t), $MachinePrecision] * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e-88], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / (-z)), $MachinePrecision] / t), $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 -1.3 \cdot 10^{-87}:\\
\;\;\;\;\frac{-1}{t} \cdot \frac{x\_m}{z}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-88}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{-z}}{t}\\
\end{array}
\end{array}
if z < -1.30000000000000001e-87Initial program 88.1%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around inf 40.6%
Taylor expanded in y around 0 29.5%
associate-*r/29.5%
neg-mul-129.5%
Simplified29.5%
neg-mul-129.5%
times-frac39.6%
Applied egg-rr39.6%
if -1.30000000000000001e-87 < z < 1.14999999999999993e-88Initial program 98.5%
Taylor expanded in z around 0 70.7%
if 1.14999999999999993e-88 < z Initial program 86.4%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around inf 53.8%
Taylor expanded in y around 0 48.2%
associate-*r/48.2%
neg-mul-148.2%
Simplified48.2%
Taylor expanded in x around 0 48.2%
mul-1-neg48.2%
associate-/l/50.8%
distribute-neg-frac250.8%
Simplified50.8%
Final simplification53.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 (or (<= z -7.8e+25) (not (<= z 2.2e+54)))
(/ x_m (* z t))
(/ x_m (* y t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -7.8e+25) || !(z <= 2.2e+54)) {
tmp = x_m / (z * t);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-7.8d+25)) .or. (.not. (z <= 2.2d+54))) then
tmp = x_m / (z * t)
else
tmp = x_m / (y * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -7.8e+25) || !(z <= 2.2e+54)) {
tmp = x_m / (z * t);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -7.8e+25) or not (z <= 2.2e+54): tmp = x_m / (z * t) else: tmp = x_m / (y * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -7.8e+25) || !(z <= 2.2e+54)) tmp = Float64(x_m / Float64(z * t)); else tmp = Float64(x_m / Float64(y * t)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if ((z <= -7.8e+25) || ~((z <= 2.2e+54))) tmp = x_m / (z * t); else tmp = x_m / (y * 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[z, -7.8e+25], N[Not[LessEqual[z, 2.2e+54]], $MachinePrecision]], N[(x$95$m / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+25} \lor \neg \left(z \leq 2.2 \cdot 10^{+54}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -7.8000000000000004e25 or 2.1999999999999999e54 < z Initial program 82.4%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around inf 41.2%
Taylor expanded in y around 0 38.3%
associate-*r/38.3%
neg-mul-138.3%
Simplified38.3%
add-sqr-sqrt20.9%
sqrt-unprod39.3%
sqr-neg39.3%
sqrt-unprod16.4%
add-sqr-sqrt36.5%
*-un-lft-identity36.5%
*-commutative36.5%
associate-/r*42.3%
Applied egg-rr42.3%
*-lft-identity42.3%
associate-/l/36.5%
*-commutative36.5%
Simplified36.5%
if -7.8000000000000004e25 < z < 2.1999999999999999e54Initial program 97.7%
Taylor expanded in z around 0 53.2%
Final simplification45.9%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= z -7.8e+25)
(/ (/ x_m z) t)
(if (<= z 4.2e+54) (/ x_m (* y t)) (/ x_m (* z t))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -7.8e+25) {
tmp = (x_m / z) / t;
} else if (z <= 4.2e+54) {
tmp = x_m / (y * t);
} else {
tmp = x_m / (z * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-7.8d+25)) then
tmp = (x_m / z) / t
else if (z <= 4.2d+54) then
tmp = x_m / (y * t)
else
tmp = x_m / (z * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -7.8e+25) {
tmp = (x_m / z) / t;
} else if (z <= 4.2e+54) {
tmp = x_m / (y * t);
} else {
tmp = x_m / (z * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if z <= -7.8e+25: tmp = (x_m / z) / t elif z <= 4.2e+54: tmp = x_m / (y * t) else: tmp = x_m / (z * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -7.8e+25) tmp = Float64(Float64(x_m / z) / t); elseif (z <= 4.2e+54) tmp = Float64(x_m / Float64(y * t)); else tmp = Float64(x_m / Float64(z * t)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (z <= -7.8e+25) tmp = (x_m / z) / t; elseif (z <= 4.2e+54) tmp = x_m / (y * t); else tmp = x_m / (z * t); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -7.8e+25], N[(N[(x$95$m / z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 4.2e+54], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(z * t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+25}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{t}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+54}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z \cdot t}\\
\end{array}
\end{array}
if z < -7.8000000000000004e25Initial program 83.4%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around inf 37.9%
Taylor expanded in y around 0 31.6%
associate-*r/31.6%
neg-mul-131.6%
Simplified31.6%
associate-/r*35.6%
div-inv35.6%
add-sqr-sqrt20.1%
sqrt-unprod37.5%
sqr-neg37.5%
sqrt-unprod11.8%
add-sqr-sqrt28.3%
Applied egg-rr28.3%
associate-*l/38.4%
div-inv38.4%
Applied egg-rr38.4%
if -7.8000000000000004e25 < z < 4.19999999999999972e54Initial program 97.7%
Taylor expanded in z around 0 53.2%
if 4.19999999999999972e54 < z Initial program 81.0%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 46.0%
Taylor expanded in y around 0 47.7%
associate-*r/47.7%
neg-mul-147.7%
Simplified47.7%
add-sqr-sqrt24.8%
sqrt-unprod42.8%
sqr-neg42.8%
sqrt-unprod22.7%
add-sqr-sqrt47.6%
*-un-lft-identity47.6%
*-commutative47.6%
associate-/r*47.7%
Applied egg-rr47.7%
*-lft-identity47.7%
associate-/l/47.6%
*-commutative47.6%
Simplified47.6%
Final simplification48.4%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= y -9.5e+43) (/ (/ x_m y) (- t z)) (/ x_m (* (- y z) t)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -9.5e+43) {
tmp = (x_m / y) / (t - z);
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-9.5d+43)) then
tmp = (x_m / y) / (t - z)
else
tmp = x_m / ((y - z) * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -9.5e+43) {
tmp = (x_m / y) / (t - z);
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -9.5e+43: tmp = (x_m / y) / (t - z) else: tmp = x_m / ((y - z) * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -9.5e+43) tmp = Float64(Float64(x_m / y) / Float64(t - z)); else tmp = Float64(x_m / Float64(Float64(y - z) * t)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (y <= -9.5e+43) tmp = (x_m / y) / (t - z); else tmp = x_m / ((y - z) * t); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -9.5e+43], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+43}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -9.5000000000000004e43Initial program 85.3%
Taylor expanded in x around 0 85.3%
associate-/l/94.9%
Simplified94.9%
Taylor expanded in y around inf 84.0%
if -9.5000000000000004e43 < y Initial program 92.9%
Taylor expanded in t around inf 57.0%
Final simplification63.4%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= y -2.08e+43) (/ x_m (* y (- t z))) (/ x_m (* (- y z) t)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -2.08e+43) {
tmp = x_m / (y * (t - z));
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.08d+43)) then
tmp = x_m / (y * (t - z))
else
tmp = x_m / ((y - z) * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -2.08e+43) {
tmp = x_m / (y * (t - z));
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -2.08e+43: tmp = x_m / (y * (t - z)) else: tmp = x_m / ((y - z) * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -2.08e+43) tmp = Float64(x_m / Float64(y * Float64(t - z))); else tmp = Float64(x_m / Float64(Float64(y - z) * t)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (y <= -2.08e+43) tmp = x_m / (y * (t - z)); else tmp = x_m / ((y - z) * t); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -2.08e+43], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.08 \cdot 10^{+43}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -2.07999999999999992e43Initial program 85.3%
Taylor expanded in y around inf 83.6%
*-commutative83.6%
Simplified83.6%
if -2.07999999999999992e43 < y Initial program 92.9%
Taylor expanded in t around inf 57.0%
Final simplification63.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 t))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m / (y * t));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x_s * (x_m / (y * t))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m / (y * t));
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): return x_s * (x_m / (y * t))
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(x_m / Float64(y * t))) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z, t) tmp = x_s * (x_m / (y * t)); end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \frac{x\_m}{y \cdot t}
\end{array}
Initial program 91.1%
Taylor expanded in z around 0 40.5%
Final simplification40.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t z)))) (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
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
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) * (t - z)
if ((x / t_1) < 0.0d0) then
tmp = (x / (y - z)) / (t - z)
else
tmp = x * (1.0d0 / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if (x / t_1) < 0.0: tmp = (x / (y - z)) / (t - z) else: tmp = x * (1.0 / t_1) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (Float64(x / t_1) < 0.0) tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); else tmp = Float64(x * Float64(1.0 / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - z); tmp = 0.0; if ((x / t_1) < 0.0) tmp = (x / (y - z)) / (t - z); else tmp = x * (1.0 / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;\frac{x}{t\_1} < 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024106
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:alt
(if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))
(/ x (* (- y z) (- t z))))