
(FPCore (x y z) :precision binary64 (/ (+ x y) (- 1.0 (/ y z))))
double code(double x, double y, double z) {
return (x + y) / (1.0 - (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 = (x + y) / (1.0d0 - (y / z))
end function
public static double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
def code(x, y, z): return (x + y) / (1.0 - (y / z))
function code(x, y, z) return Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))) end
function tmp = code(x, y, z) tmp = (x + y) / (1.0 - (y / z)); end
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y}{1 - \frac{y}{z}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (+ x y) (- 1.0 (/ y z))))
double code(double x, double y, double z) {
return (x + y) / (1.0 - (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 = (x + y) / (1.0d0 - (y / z))
end function
public static double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
def code(x, y, z): return (x + y) / (1.0 - (y / z))
function code(x, y, z) return Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))) end
function tmp = code(x, y, z) tmp = (x + y) / (1.0 - (y / z)); end
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y}{1 - \frac{y}{z}}
\end{array}
(FPCore (x y z) :precision binary64 (let* ((t_0 (/ (+ x y) (- 1.0 (/ y z))))) (if (or (<= t_0 -1e-254) (not (<= t_0 0.0))) t_0 (* z (- -1.0 (/ x y))))))
double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -1e-254) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = z * (-1.0 - (x / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (x + y) / (1.0d0 - (y / z))
if ((t_0 <= (-1d-254)) .or. (.not. (t_0 <= 0.0d0))) then
tmp = t_0
else
tmp = z * ((-1.0d0) - (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -1e-254) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = z * (-1.0 - (x / y));
}
return tmp;
}
def code(x, y, z): t_0 = (x + y) / (1.0 - (y / z)) tmp = 0 if (t_0 <= -1e-254) or not (t_0 <= 0.0): tmp = t_0 else: tmp = z * (-1.0 - (x / y)) return tmp
function code(x, y, z) t_0 = Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))) tmp = 0.0 if ((t_0 <= -1e-254) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(z * Float64(-1.0 - Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x + y) / (1.0 - (y / z)); tmp = 0.0; if ((t_0 <= -1e-254) || ~((t_0 <= 0.0))) tmp = t_0; else tmp = z * (-1.0 - (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -1e-254], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{-254} \lor \neg \left(t_0 \leq 0\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))) (t_1 (/ y t_0)))
(if (<= y -1.65e+178)
(- z)
(if (<= y -1e-17)
t_1
(if (<= y 5.5e-76) (/ x t_0) (if (<= y 3.1e+139) t_1 (- z)))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = y / t_0;
double tmp;
if (y <= -1.65e+178) {
tmp = -z;
} else if (y <= -1e-17) {
tmp = t_1;
} else if (y <= 5.5e-76) {
tmp = x / t_0;
} else if (y <= 3.1e+139) {
tmp = t_1;
} else {
tmp = -z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (y / z)
t_1 = y / t_0
if (y <= (-1.65d+178)) then
tmp = -z
else if (y <= (-1d-17)) then
tmp = t_1
else if (y <= 5.5d-76) then
tmp = x / t_0
else if (y <= 3.1d+139) then
tmp = t_1
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = y / t_0;
double tmp;
if (y <= -1.65e+178) {
tmp = -z;
} else if (y <= -1e-17) {
tmp = t_1;
} else if (y <= 5.5e-76) {
tmp = x / t_0;
} else if (y <= 3.1e+139) {
tmp = t_1;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) t_1 = y / t_0 tmp = 0 if y <= -1.65e+178: tmp = -z elif y <= -1e-17: tmp = t_1 elif y <= 5.5e-76: tmp = x / t_0 elif y <= 3.1e+139: tmp = t_1 else: tmp = -z return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) t_1 = Float64(y / t_0) tmp = 0.0 if (y <= -1.65e+178) tmp = Float64(-z); elseif (y <= -1e-17) tmp = t_1; elseif (y <= 5.5e-76) tmp = Float64(x / t_0); elseif (y <= 3.1e+139) tmp = t_1; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); t_1 = y / t_0; tmp = 0.0; if (y <= -1.65e+178) tmp = -z; elseif (y <= -1e-17) tmp = t_1; elseif (y <= 5.5e-76) tmp = x / t_0; elseif (y <= 3.1e+139) tmp = t_1; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y / t$95$0), $MachinePrecision]}, If[LessEqual[y, -1.65e+178], (-z), If[LessEqual[y, -1e-17], t$95$1, If[LessEqual[y, 5.5e-76], N[(x / t$95$0), $MachinePrecision], If[LessEqual[y, 3.1e+139], t$95$1, (-z)]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := \frac{y}{t_0}\\
\mathbf{if}\;y \leq -1.65 \cdot 10^{+178}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-76}:\\
\;\;\;\;\frac{x}{t_0}\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+139}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))) (t_1 (* z (- -1.0 (/ x y)))))
(if (<= y -2.9e+30)
t_1
(if (<= y 5.5e-76) (/ x t_0) (if (<= y 2.4e+44) (/ y t_0) t_1)))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = z * (-1.0 - (x / y));
double tmp;
if (y <= -2.9e+30) {
tmp = t_1;
} else if (y <= 5.5e-76) {
tmp = x / t_0;
} else if (y <= 2.4e+44) {
tmp = y / t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (y / z)
t_1 = z * ((-1.0d0) - (x / y))
if (y <= (-2.9d+30)) then
tmp = t_1
else if (y <= 5.5d-76) then
tmp = x / t_0
else if (y <= 2.4d+44) then
tmp = y / t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = z * (-1.0 - (x / y));
double tmp;
if (y <= -2.9e+30) {
tmp = t_1;
} else if (y <= 5.5e-76) {
tmp = x / t_0;
} else if (y <= 2.4e+44) {
tmp = y / t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) t_1 = z * (-1.0 - (x / y)) tmp = 0 if y <= -2.9e+30: tmp = t_1 elif y <= 5.5e-76: tmp = x / t_0 elif y <= 2.4e+44: tmp = y / t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) t_1 = Float64(z * Float64(-1.0 - Float64(x / y))) tmp = 0.0 if (y <= -2.9e+30) tmp = t_1; elseif (y <= 5.5e-76) tmp = Float64(x / t_0); elseif (y <= 2.4e+44) tmp = Float64(y / t_0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); t_1 = z * (-1.0 - (x / y)); tmp = 0.0; if (y <= -2.9e+30) tmp = t_1; elseif (y <= 5.5e-76) tmp = x / t_0; elseif (y <= 2.4e+44) tmp = y / t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.9e+30], t$95$1, If[LessEqual[y, 5.5e-76], N[(x / t$95$0), $MachinePrecision], If[LessEqual[y, 2.4e+44], N[(y / t$95$0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := z \cdot \left(-1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -2.9 \cdot 10^{+30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-76}:\\
\;\;\;\;\frac{x}{t_0}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+44}:\\
\;\;\;\;\frac{y}{t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= y -5e-18) (not (<= y 4e-76))) (/ 1.0 (+ (/ 1.0 y) (/ -1.0 z))) (/ x (- 1.0 (/ y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -5e-18) || !(y <= 4e-76)) {
tmp = 1.0 / ((1.0 / y) + (-1.0 / z));
} else {
tmp = x / (1.0 - (y / z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-5d-18)) .or. (.not. (y <= 4d-76))) then
tmp = 1.0d0 / ((1.0d0 / y) + ((-1.0d0) / z))
else
tmp = x / (1.0d0 - (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -5e-18) || !(y <= 4e-76)) {
tmp = 1.0 / ((1.0 / y) + (-1.0 / z));
} else {
tmp = x / (1.0 - (y / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -5e-18) or not (y <= 4e-76): tmp = 1.0 / ((1.0 / y) + (-1.0 / z)) else: tmp = x / (1.0 - (y / z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -5e-18) || !(y <= 4e-76)) tmp = Float64(1.0 / Float64(Float64(1.0 / y) + Float64(-1.0 / z))); else tmp = Float64(x / Float64(1.0 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -5e-18) || ~((y <= 4e-76))) tmp = 1.0 / ((1.0 / y) + (-1.0 / z)); else tmp = x / (1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -5e-18], N[Not[LessEqual[y, 4e-76]], $MachinePrecision]], N[(1.0 / N[(N[(1.0 / y), $MachinePrecision] + N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-18} \lor \neg \left(y \leq 4 \cdot 10^{-76}\right):\\
\;\;\;\;\frac{1}{\frac{1}{y} + \frac{-1}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= y -1.5e+35)
(- z)
(if (<= y 7.6e-89)
(/ x (- 1.0 (/ y z)))
(if (<= y 2.9e+68) (+ x y) (- z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.5e+35) {
tmp = -z;
} else if (y <= 7.6e-89) {
tmp = x / (1.0 - (y / z));
} else if (y <= 2.9e+68) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1.5d+35)) then
tmp = -z
else if (y <= 7.6d-89) then
tmp = x / (1.0d0 - (y / z))
else if (y <= 2.9d+68) then
tmp = x + y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.5e+35) {
tmp = -z;
} else if (y <= 7.6e-89) {
tmp = x / (1.0 - (y / z));
} else if (y <= 2.9e+68) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.5e+35: tmp = -z elif y <= 7.6e-89: tmp = x / (1.0 - (y / z)) elif y <= 2.9e+68: tmp = x + y else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.5e+35) tmp = Float64(-z); elseif (y <= 7.6e-89) tmp = Float64(x / Float64(1.0 - Float64(y / z))); elseif (y <= 2.9e+68) tmp = Float64(x + y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.5e+35) tmp = -z; elseif (y <= 7.6e-89) tmp = x / (1.0 - (y / z)); elseif (y <= 2.9e+68) tmp = x + y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.5e+35], (-z), If[LessEqual[y, 7.6e-89], N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e+68], N[(x + y), $MachinePrecision], (-z)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+35}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{-89}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+68}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= y -4.8e+33) (not (<= y 1e+67))) (- z) (+ x y)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4.8e+33) || !(y <= 1e+67)) {
tmp = -z;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-4.8d+33)) .or. (.not. (y <= 1d+67))) then
tmp = -z
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -4.8e+33) || !(y <= 1e+67)) {
tmp = -z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4.8e+33) or not (y <= 1e+67): tmp = -z else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4.8e+33) || !(y <= 1e+67)) tmp = Float64(-z); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -4.8e+33) || ~((y <= 1e+67))) tmp = -z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4.8e+33], N[Not[LessEqual[y, 1e+67]], $MachinePrecision]], (-z), N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+33} \lor \neg \left(y \leq 10^{+67}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= y -8.8e+32) (not (<= y 1.62e-68))) (- z) x))
double code(double x, double y, double z) {
double tmp;
if ((y <= -8.8e+32) || !(y <= 1.62e-68)) {
tmp = -z;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-8.8d+32)) .or. (.not. (y <= 1.62d-68))) then
tmp = -z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -8.8e+32) || !(y <= 1.62e-68)) {
tmp = -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -8.8e+32) or not (y <= 1.62e-68): tmp = -z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -8.8e+32) || !(y <= 1.62e-68)) tmp = Float64(-z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -8.8e+32) || ~((y <= 1.62e-68))) tmp = -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -8.8e+32], N[Not[LessEqual[y, 1.62e-68]], $MachinePrecision]], (-z), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.8 \cdot 10^{+32} \lor \neg \left(y \leq 1.62 \cdot 10^{-68}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= y -2.5e-19) y (if (<= y 3e-76) x y)))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.5e-19) {
tmp = y;
} else if (y <= 3e-76) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-2.5d-19)) then
tmp = y
else if (y <= 3d-76) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.5e-19) {
tmp = y;
} else if (y <= 3e-76) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.5e-19: tmp = y elif y <= 3e-76: tmp = x else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.5e-19) tmp = y; elseif (y <= 3e-76) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.5e-19) tmp = y; elseif (y <= 3e-76) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.5e-19], y, If[LessEqual[y, 3e-76], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-19}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-76}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ (+ y x) (- y)) z)))
(if (< y -3.7429310762689856e+171)
t_0
(if (< y 3.5534662456086734e+168) (/ (+ x y) (- 1.0 (/ y z))) t_0))))
double code(double x, double y, double z) {
double t_0 = ((y + x) / -y) * z;
double tmp;
if (y < -3.7429310762689856e+171) {
tmp = t_0;
} else if (y < 3.5534662456086734e+168) {
tmp = (x + y) / (1.0 - (y / z));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((y + x) / -y) * z
if (y < (-3.7429310762689856d+171)) then
tmp = t_0
else if (y < 3.5534662456086734d+168) then
tmp = (x + y) / (1.0d0 - (y / z))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((y + x) / -y) * z;
double tmp;
if (y < -3.7429310762689856e+171) {
tmp = t_0;
} else if (y < 3.5534662456086734e+168) {
tmp = (x + y) / (1.0 - (y / z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((y + x) / -y) * z tmp = 0 if y < -3.7429310762689856e+171: tmp = t_0 elif y < 3.5534662456086734e+168: tmp = (x + y) / (1.0 - (y / z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(y + x) / Float64(-y)) * z) tmp = 0.0 if (y < -3.7429310762689856e+171) tmp = t_0; elseif (y < 3.5534662456086734e+168) tmp = Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((y + x) / -y) * z; tmp = 0.0; if (y < -3.7429310762689856e+171) tmp = t_0; elseif (y < 3.5534662456086734e+168) tmp = (x + y) / (1.0 - (y / z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y + x), $MachinePrecision] / (-y)), $MachinePrecision] * z), $MachinePrecision]}, If[Less[y, -3.7429310762689856e+171], t$95$0, If[Less[y, 3.5534662456086734e+168], N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y + x}{-y} \cdot z\\
\mathbf{if}\;y < -3.7429310762689856 \cdot 10^{+171}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y < 3.5534662456086734 \cdot 10^{+168}:\\
\;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
herbie shell --seed 2023350
(FPCore (x y z)
:name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"
:precision binary64
:herbie-target
(if (< y -3.7429310762689856e+171) (* (/ (+ y x) (- y)) z) (if (< y 3.5534662456086734e+168) (/ (+ x y) (- 1.0 (/ y z))) (* (/ (+ y x) (- y)) z)))
(/ (+ x y) (- 1.0 (/ y z))))