
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 0.12) (fabs (/ (+ (* x (- 1.0 z)) 4.0) y_m)) (fabs (fma x (/ z y_m) (/ (- -4.0 x) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 0.12) {
tmp = fabs((((x * (1.0 - z)) + 4.0) / y_m));
} else {
tmp = fabs(fma(x, (z / y_m), ((-4.0 - x) / y_m)));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 0.12) tmp = abs(Float64(Float64(Float64(x * Float64(1.0 - z)) + 4.0) / y_m)); else tmp = abs(fma(x, Float64(z / y_m), Float64(Float64(-4.0 - x) / y_m))); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 0.12], N[Abs[N[(N[(N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision] + N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y_m \leq 0.12:\\
\;\;\;\;\left|\frac{x \cdot \left(1 - z\right) + 4}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(x, \frac{z}{y_m}, \frac{-4 - x}{y_m}\right)\right|\\
\end{array}
\end{array}
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y_m)) (t_1 (* z (/ x y_m))))
(if (<= (- t_0 t_1) 5e+300)
(fabs (- t_1 t_0))
(fabs (/ (+ (* x (- 1.0 z)) 4.0) y_m)))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double t_1 = z * (x / y_m);
double tmp;
if ((t_0 - t_1) <= 5e+300) {
tmp = fabs((t_1 - t_0));
} else {
tmp = fabs((((x * (1.0 - z)) + 4.0) / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x + 4.0d0) / y_m
t_1 = z * (x / y_m)
if ((t_0 - t_1) <= 5d+300) then
tmp = abs((t_1 - t_0))
else
tmp = abs((((x * (1.0d0 - z)) + 4.0d0) / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double t_1 = z * (x / y_m);
double tmp;
if ((t_0 - t_1) <= 5e+300) {
tmp = Math.abs((t_1 - t_0));
} else {
tmp = Math.abs((((x * (1.0 - z)) + 4.0) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = (x + 4.0) / y_m t_1 = z * (x / y_m) tmp = 0 if (t_0 - t_1) <= 5e+300: tmp = math.fabs((t_1 - t_0)) else: tmp = math.fabs((((x * (1.0 - z)) + 4.0) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(x + 4.0) / y_m) t_1 = Float64(z * Float64(x / y_m)) tmp = 0.0 if (Float64(t_0 - t_1) <= 5e+300) tmp = abs(Float64(t_1 - t_0)); else tmp = abs(Float64(Float64(Float64(x * Float64(1.0 - z)) + 4.0) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = (x + 4.0) / y_m; t_1 = z * (x / y_m); tmp = 0.0; if ((t_0 - t_1) <= 5e+300) tmp = abs((t_1 - t_0)); else tmp = abs((((x * (1.0 - z)) + 4.0) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 - t$95$1), $MachinePrecision], 5e+300], N[Abs[N[(t$95$1 - t$95$0), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y_m}\\
t_1 := z \cdot \frac{x}{y_m}\\
\mathbf{if}\;t_0 - t_1 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;\left|t_1 - t_0\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x \cdot \left(1 - z\right) + 4}{y_m}\right|\\
\end{array}
\end{array}
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))) (t_1 (fabs (* z (/ x y_m)))))
(if (<= x -4.4e+186)
t_0
(if (<= x -1.55e-18)
t_1
(if (<= x 3.1e-25) (fabs (/ 4.0 y_m)) (if (<= x 3.4e+115) t_1 t_0))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x / y_m));
double t_1 = fabs((z * (x / y_m)));
double tmp;
if (x <= -4.4e+186) {
tmp = t_0;
} else if (x <= -1.55e-18) {
tmp = t_1;
} else if (x <= 3.1e-25) {
tmp = fabs((4.0 / y_m));
} else if (x <= 3.4e+115) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = abs((x / y_m))
t_1 = abs((z * (x / y_m)))
if (x <= (-4.4d+186)) then
tmp = t_0
else if (x <= (-1.55d-18)) then
tmp = t_1
else if (x <= 3.1d-25) then
tmp = abs((4.0d0 / y_m))
else if (x <= 3.4d+115) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = Math.abs((x / y_m));
double t_1 = Math.abs((z * (x / y_m)));
double tmp;
if (x <= -4.4e+186) {
tmp = t_0;
} else if (x <= -1.55e-18) {
tmp = t_1;
} else if (x <= 3.1e-25) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 3.4e+115) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x / y_m)) t_1 = math.fabs((z * (x / y_m))) tmp = 0 if x <= -4.4e+186: tmp = t_0 elif x <= -1.55e-18: tmp = t_1 elif x <= 3.1e-25: tmp = math.fabs((4.0 / y_m)) elif x <= 3.4e+115: tmp = t_1 else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x / y_m)) t_1 = abs(Float64(z * Float64(x / y_m))) tmp = 0.0 if (x <= -4.4e+186) tmp = t_0; elseif (x <= -1.55e-18) tmp = t_1; elseif (x <= 3.1e-25) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 3.4e+115) tmp = t_1; else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((x / y_m)); t_1 = abs((z * (x / y_m))); tmp = 0.0; if (x <= -4.4e+186) tmp = t_0; elseif (x <= -1.55e-18) tmp = t_1; elseif (x <= 3.1e-25) tmp = abs((4.0 / y_m)); elseif (x <= 3.4e+115) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -4.4e+186], t$95$0, If[LessEqual[x, -1.55e-18], t$95$1, If[LessEqual[x, 3.1e-25], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 3.4e+115], t$95$1, t$95$0]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y_m}\right|\\
t_1 := \left|z \cdot \frac{x}{y_m}\right|\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{+186}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{-18}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-25}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+115}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -2.2e-35) (not (<= x 2.7e-25))) (fabs (* x (/ (- 1.0 z) y_m))) (fabs (/ 4.0 y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -2.2e-35) || !(x <= 2.7e-25)) {
tmp = fabs((x * ((1.0 - z) / y_m)));
} else {
tmp = fabs((4.0 / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-2.2d-35)) .or. (.not. (x <= 2.7d-25))) then
tmp = abs((x * ((1.0d0 - z) / y_m)))
else
tmp = abs((4.0d0 / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if ((x <= -2.2e-35) || !(x <= 2.7e-25)) {
tmp = Math.abs((x * ((1.0 - z) / y_m)));
} else {
tmp = Math.abs((4.0 / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -2.2e-35) or not (x <= 2.7e-25): tmp = math.fabs((x * ((1.0 - z) / y_m))) else: tmp = math.fabs((4.0 / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -2.2e-35) || !(x <= 2.7e-25)) tmp = abs(Float64(x * Float64(Float64(1.0 - z) / y_m))); else tmp = abs(Float64(4.0 / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if ((x <= -2.2e-35) || ~((x <= 2.7e-25))) tmp = abs((x * ((1.0 - z) / y_m))); else tmp = abs((4.0 / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[Or[LessEqual[x, -2.2e-35], N[Not[LessEqual[x, 2.7e-25]], $MachinePrecision]], N[Abs[N[(x * N[(N[(1.0 - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-35} \lor \neg \left(x \leq 2.7 \cdot 10^{-25}\right):\\
\;\;\;\;\left|x \cdot \frac{1 - z}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\end{array}
\end{array}
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -5e-40) (not (<= x 2.6e-25))) (fabs (* (- 1.0 z) (/ x y_m))) (fabs (/ 4.0 y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -5e-40) || !(x <= 2.6e-25)) {
tmp = fabs(((1.0 - z) * (x / y_m)));
} else {
tmp = fabs((4.0 / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-5d-40)) .or. (.not. (x <= 2.6d-25))) then
tmp = abs(((1.0d0 - z) * (x / y_m)))
else
tmp = abs((4.0d0 / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if ((x <= -5e-40) || !(x <= 2.6e-25)) {
tmp = Math.abs(((1.0 - z) * (x / y_m)));
} else {
tmp = Math.abs((4.0 / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -5e-40) or not (x <= 2.6e-25): tmp = math.fabs(((1.0 - z) * (x / y_m))) else: tmp = math.fabs((4.0 / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -5e-40) || !(x <= 2.6e-25)) tmp = abs(Float64(Float64(1.0 - z) * Float64(x / y_m))); else tmp = abs(Float64(4.0 / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if ((x <= -5e-40) || ~((x <= 2.6e-25))) tmp = abs(((1.0 - z) * (x / y_m))); else tmp = abs((4.0 / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[Or[LessEqual[x, -5e-40], N[Not[LessEqual[x, 2.6e-25]], $MachinePrecision]], N[Abs[N[(N[(1.0 - z), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-40} \lor \neg \left(x \leq 2.6 \cdot 10^{-25}\right):\\
\;\;\;\;\left|\left(1 - z\right) \cdot \frac{x}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\end{array}
\end{array}
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -1.55) (not (<= x 2.2e-9))) (fabs (* (- 1.0 z) (/ x y_m))) (fabs (/ (- 4.0 (* x z)) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -1.55) || !(x <= 2.2e-9)) {
tmp = fabs(((1.0 - z) * (x / y_m)));
} else {
tmp = fabs(((4.0 - (x * z)) / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.55d0)) .or. (.not. (x <= 2.2d-9))) then
tmp = abs(((1.0d0 - z) * (x / y_m)))
else
tmp = abs(((4.0d0 - (x * z)) / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if ((x <= -1.55) || !(x <= 2.2e-9)) {
tmp = Math.abs(((1.0 - z) * (x / y_m)));
} else {
tmp = Math.abs(((4.0 - (x * z)) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -1.55) or not (x <= 2.2e-9): tmp = math.fabs(((1.0 - z) * (x / y_m))) else: tmp = math.fabs(((4.0 - (x * z)) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -1.55) || !(x <= 2.2e-9)) tmp = abs(Float64(Float64(1.0 - z) * Float64(x / y_m))); else tmp = abs(Float64(Float64(4.0 - Float64(x * z)) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if ((x <= -1.55) || ~((x <= 2.2e-9))) tmp = abs(((1.0 - z) * (x / y_m))); else tmp = abs(((4.0 - (x * z)) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[Or[LessEqual[x, -1.55], N[Not[LessEqual[x, 2.2e-9]], $MachinePrecision]], N[Abs[N[(N[(1.0 - z), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \lor \neg \left(x \leq 2.2 \cdot 10^{-9}\right):\\
\;\;\;\;\left|\left(1 - z\right) \cdot \frac{x}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4 - x \cdot z}{y_m}\right|\\
\end{array}
\end{array}
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x 1.6e+14) (fabs (/ (+ (* x (- 1.0 z)) 4.0) y_m)) (fabs (* (- 1.0 z) (/ x y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= 1.6e+14) {
tmp = fabs((((x * (1.0 - z)) + 4.0) / y_m));
} else {
tmp = fabs(((1.0 - z) * (x / y_m)));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.6d+14) then
tmp = abs((((x * (1.0d0 - z)) + 4.0d0) / y_m))
else
tmp = abs(((1.0d0 - z) * (x / y_m)))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= 1.6e+14) {
tmp = Math.abs((((x * (1.0 - z)) + 4.0) / y_m));
} else {
tmp = Math.abs(((1.0 - z) * (x / y_m)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= 1.6e+14: tmp = math.fabs((((x * (1.0 - z)) + 4.0) / y_m)) else: tmp = math.fabs(((1.0 - z) * (x / y_m))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= 1.6e+14) tmp = abs(Float64(Float64(Float64(x * Float64(1.0 - z)) + 4.0) / y_m)); else tmp = abs(Float64(Float64(1.0 - z) * Float64(x / y_m))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= 1.6e+14) tmp = abs((((x * (1.0 - z)) + 4.0) / y_m)); else tmp = abs(((1.0 - z) * (x / y_m))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, 1.6e+14], N[Abs[N[(N[(N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(1.0 - z), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.6 \cdot 10^{+14}:\\
\;\;\;\;\left|\frac{x \cdot \left(1 - z\right) + 4}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(1 - z\right) \cdot \frac{x}{y_m}\right|\\
\end{array}
\end{array}
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -1.3e+131) (fabs (/ z (/ y_m x))) (if (<= z 7.2e+17) (fabs (/ (- -4.0 x) y_m)) (fabs (* z (/ x y_m))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -1.3e+131) {
tmp = fabs((z / (y_m / x)));
} else if (z <= 7.2e+17) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs((z * (x / y_m)));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.3d+131)) then
tmp = abs((z / (y_m / x)))
else if (z <= 7.2d+17) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs((z * (x / y_m)))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (z <= -1.3e+131) {
tmp = Math.abs((z / (y_m / x)));
} else if (z <= 7.2e+17) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs((z * (x / y_m)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -1.3e+131: tmp = math.fabs((z / (y_m / x))) elif z <= 7.2e+17: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs((z * (x / y_m))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -1.3e+131) tmp = abs(Float64(z / Float64(y_m / x))); elseif (z <= 7.2e+17) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(Float64(z * Float64(x / y_m))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (z <= -1.3e+131) tmp = abs((z / (y_m / x))); elseif (z <= 7.2e+17) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs((z * (x / y_m))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -1.3e+131], N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 7.2e+17], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+131}:\\
\;\;\;\;\left|\frac{z}{\frac{y_m}{x}}\right|\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+17}:\\
\;\;\;\;\left|\frac{-4 - x}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|z \cdot \frac{x}{y_m}\right|\\
\end{array}
\end{array}
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -1.55) (not (<= x 4.0))) (fabs (/ x y_m)) (fabs (/ 4.0 y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -1.55) || !(x <= 4.0)) {
tmp = fabs((x / y_m));
} else {
tmp = fabs((4.0 / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.55d0)) .or. (.not. (x <= 4.0d0))) then
tmp = abs((x / y_m))
else
tmp = abs((4.0d0 / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if ((x <= -1.55) || !(x <= 4.0)) {
tmp = Math.abs((x / y_m));
} else {
tmp = Math.abs((4.0 / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -1.55) or not (x <= 4.0): tmp = math.fabs((x / y_m)) else: tmp = math.fabs((4.0 / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -1.55) || !(x <= 4.0)) tmp = abs(Float64(x / y_m)); else tmp = abs(Float64(4.0 / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if ((x <= -1.55) || ~((x <= 4.0))) tmp = abs((x / y_m)); else tmp = abs((4.0 / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[Or[LessEqual[x, -1.55], N[Not[LessEqual[x, 4.0]], $MachinePrecision]], N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \lor \neg \left(x \leq 4\right):\\
\;\;\;\;\left|\frac{x}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\end{array}
\end{array}
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (fabs (/ 4.0 y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
return fabs((4.0 / y_m));
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
code = abs((4.0d0 / y_m))
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
return Math.abs((4.0 / y_m));
}
y_m = math.fabs(y) def code(x, y_m, z): return math.fabs((4.0 / y_m))
y_m = abs(y) function code(x, y_m, z) return abs(Float64(4.0 / y_m)) end
y_m = abs(y); function tmp = code(x, y_m, z) tmp = abs((4.0 / y_m)); end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\left|\frac{4}{y_m}\right|
\end{array}
herbie shell --seed 2023347
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))