
(FPCore (x y z) :precision binary64 (/ (* x (+ y z)) z))
double code(double x, double y, double z) {
return (x * (y + z)) / 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 + z)) / z
end function
public static double code(double x, double y, double z) {
return (x * (y + z)) / z;
}
def code(x, y, z): return (x * (y + z)) / z
function code(x, y, z) return Float64(Float64(x * Float64(y + z)) / z) end
function tmp = code(x, y, z) tmp = (x * (y + z)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y + z\right)}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* x (+ y z)) z))
double code(double x, double y, double z) {
return (x * (y + z)) / 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 + z)) / z
end function
public static double code(double x, double y, double z) {
return (x * (y + z)) / z;
}
def code(x, y, z): return (x * (y + z)) / z
function code(x, y, z) return Float64(Float64(x * Float64(y + z)) / z) end
function tmp = code(x, y, z) tmp = (x * (y + z)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y + z\right)}{z}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= y 2.8e+65) (fma x (/ y z) x) (/ (* x (+ y z)) z)))
double code(double x, double y, double z) {
double tmp;
if (y <= 2.8e+65) {
tmp = fma(x, (y / z), x);
} else {
tmp = (x * (y + z)) / z;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= 2.8e+65) tmp = fma(x, Float64(y / z), x); else tmp = Float64(Float64(x * Float64(y + z)) / z); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, 2.8e+65], N[(x * N[(y / z), $MachinePrecision] + x), $MachinePrecision], N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.8 \cdot 10^{+65}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{y}{z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y + z\right)}{z}\\
\end{array}
\end{array}
if y < 2.7999999999999999e65Initial program 83.3%
remove-double-neg83.3%
distribute-lft-neg-out83.3%
*-commutative83.3%
distribute-lft-neg-in83.3%
associate-/l*84.2%
distribute-neg-in84.2%
unsub-neg84.2%
div-sub79.8%
distribute-frac-neg79.8%
associate-/r/81.0%
distribute-rgt-neg-out81.0%
remove-double-neg81.0%
associate-/r/99.0%
*-inverses99.0%
*-lft-identity99.0%
*-commutative99.0%
fma-neg99.0%
remove-double-neg99.0%
Simplified99.0%
if 2.7999999999999999e65 < y Initial program 96.1%
Final simplification98.5%
(FPCore (x y z)
:precision binary64
(if (or (<= y -2e+84)
(and (not (<= y -5.6e+47))
(or (<= y -7.2e+14) (not (<= y 2.55e-27)))))
(* x (/ y z))
x))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2e+84) || (!(y <= -5.6e+47) && ((y <= -7.2e+14) || !(y <= 2.55e-27)))) {
tmp = x * (y / 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 <= (-2d+84)) .or. (.not. (y <= (-5.6d+47))) .and. (y <= (-7.2d+14)) .or. (.not. (y <= 2.55d-27))) then
tmp = x * (y / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -2e+84) || (!(y <= -5.6e+47) && ((y <= -7.2e+14) || !(y <= 2.55e-27)))) {
tmp = x * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2e+84) or (not (y <= -5.6e+47) and ((y <= -7.2e+14) or not (y <= 2.55e-27))): tmp = x * (y / z) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2e+84) || (!(y <= -5.6e+47) && ((y <= -7.2e+14) || !(y <= 2.55e-27)))) tmp = Float64(x * Float64(y / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2e+84) || (~((y <= -5.6e+47)) && ((y <= -7.2e+14) || ~((y <= 2.55e-27))))) tmp = x * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2e+84], And[N[Not[LessEqual[y, -5.6e+47]], $MachinePrecision], Or[LessEqual[y, -7.2e+14], N[Not[LessEqual[y, 2.55e-27]], $MachinePrecision]]]], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+84} \lor \neg \left(y \leq -5.6 \cdot 10^{+47}\right) \land \left(y \leq -7.2 \cdot 10^{+14} \lor \neg \left(y \leq 2.55 \cdot 10^{-27}\right)\right):\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.00000000000000012e84 or -5.59999999999999976e47 < y < -7.2e14 or 2.55e-27 < y Initial program 92.0%
associate-*l/87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in y around inf 80.5%
associate-*r/78.0%
Simplified78.0%
if -2.00000000000000012e84 < y < -5.59999999999999976e47 or -7.2e14 < y < 2.55e-27Initial program 79.3%
associate-*l/85.0%
*-commutative85.0%
Simplified85.0%
Taylor expanded in y around 0 84.7%
Final simplification81.3%
(FPCore (x y z)
:precision binary64
(if (<= y -2.5e+84)
(* x (/ y z))
(if (or (<= y -3.3e+48) (and (not (<= y -110000000000.0)) (<= y 2.4e-27)))
x
(/ y (/ z x)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.5e+84) {
tmp = x * (y / z);
} else if ((y <= -3.3e+48) || (!(y <= -110000000000.0) && (y <= 2.4e-27))) {
tmp = x;
} else {
tmp = y / (z / 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 <= (-2.5d+84)) then
tmp = x * (y / z)
else if ((y <= (-3.3d+48)) .or. (.not. (y <= (-110000000000.0d0))) .and. (y <= 2.4d-27)) then
tmp = x
else
tmp = y / (z / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.5e+84) {
tmp = x * (y / z);
} else if ((y <= -3.3e+48) || (!(y <= -110000000000.0) && (y <= 2.4e-27))) {
tmp = x;
} else {
tmp = y / (z / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.5e+84: tmp = x * (y / z) elif (y <= -3.3e+48) or (not (y <= -110000000000.0) and (y <= 2.4e-27)): tmp = x else: tmp = y / (z / x) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.5e+84) tmp = Float64(x * Float64(y / z)); elseif ((y <= -3.3e+48) || (!(y <= -110000000000.0) && (y <= 2.4e-27))) tmp = x; else tmp = Float64(y / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.5e+84) tmp = x * (y / z); elseif ((y <= -3.3e+48) || (~((y <= -110000000000.0)) && (y <= 2.4e-27))) tmp = x; else tmp = y / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.5e+84], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -3.3e+48], And[N[Not[LessEqual[y, -110000000000.0]], $MachinePrecision], LessEqual[y, 2.4e-27]]], x, N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+84}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{+48} \lor \neg \left(y \leq -110000000000\right) \land y \leq 2.4 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if y < -2.5e84Initial program 88.9%
associate-*l/86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in y around inf 74.4%
associate-*r/79.4%
Simplified79.4%
if -2.5e84 < y < -3.30000000000000023e48 or -1.1e11 < y < 2.40000000000000002e-27Initial program 79.3%
associate-*l/85.0%
*-commutative85.0%
Simplified85.0%
Taylor expanded in y around 0 84.7%
if -3.30000000000000023e48 < y < -1.1e11 or 2.40000000000000002e-27 < y Initial program 94.1%
associate-*l/87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in y around inf 84.6%
associate-*r/77.0%
Simplified77.0%
associate-*r/84.6%
*-commutative84.6%
associate-/l*83.1%
Applied egg-rr83.1%
Final simplification83.1%
(FPCore (x y z)
:precision binary64
(if (<= y -2e+84)
(* x (/ y z))
(if (or (<= y -2.25e+48) (and (not (<= y -145000000000.0)) (<= y 1.7e-27)))
x
(/ (* y x) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2e+84) {
tmp = x * (y / z);
} else if ((y <= -2.25e+48) || (!(y <= -145000000000.0) && (y <= 1.7e-27))) {
tmp = x;
} else {
tmp = (y * x) / 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 <= (-2d+84)) then
tmp = x * (y / z)
else if ((y <= (-2.25d+48)) .or. (.not. (y <= (-145000000000.0d0))) .and. (y <= 1.7d-27)) then
tmp = x
else
tmp = (y * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2e+84) {
tmp = x * (y / z);
} else if ((y <= -2.25e+48) || (!(y <= -145000000000.0) && (y <= 1.7e-27))) {
tmp = x;
} else {
tmp = (y * x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2e+84: tmp = x * (y / z) elif (y <= -2.25e+48) or (not (y <= -145000000000.0) and (y <= 1.7e-27)): tmp = x else: tmp = (y * x) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2e+84) tmp = Float64(x * Float64(y / z)); elseif ((y <= -2.25e+48) || (!(y <= -145000000000.0) && (y <= 1.7e-27))) tmp = x; else tmp = Float64(Float64(y * x) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2e+84) tmp = x * (y / z); elseif ((y <= -2.25e+48) || (~((y <= -145000000000.0)) && (y <= 1.7e-27))) tmp = x; else tmp = (y * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2e+84], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -2.25e+48], And[N[Not[LessEqual[y, -145000000000.0]], $MachinePrecision], LessEqual[y, 1.7e-27]]], x, N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+84}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq -2.25 \cdot 10^{+48} \lor \neg \left(y \leq -145000000000\right) \land y \leq 1.7 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\end{array}
\end{array}
if y < -2.00000000000000012e84Initial program 88.9%
associate-*l/86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in y around inf 74.4%
associate-*r/79.4%
Simplified79.4%
if -2.00000000000000012e84 < y < -2.24999999999999998e48 or -1.45e11 < y < 1.69999999999999985e-27Initial program 79.3%
associate-*l/85.0%
*-commutative85.0%
Simplified85.0%
Taylor expanded in y around 0 84.7%
if -2.24999999999999998e48 < y < -1.45e11 or 1.69999999999999985e-27 < y Initial program 94.1%
associate-*l/87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in y around inf 84.6%
Final simplification83.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ y z))))
(if (<= y -2e+84)
t_0
(if (<= y -2.9e+48)
x
(if (<= y -150000000000.0) t_0 (if (<= y 2.45e-27) x (/ x (/ z y))))))))
double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (y <= -2e+84) {
tmp = t_0;
} else if (y <= -2.9e+48) {
tmp = x;
} else if (y <= -150000000000.0) {
tmp = t_0;
} else if (y <= 2.45e-27) {
tmp = x;
} else {
tmp = x / (z / 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 / z)
if (y <= (-2d+84)) then
tmp = t_0
else if (y <= (-2.9d+48)) then
tmp = x
else if (y <= (-150000000000.0d0)) then
tmp = t_0
else if (y <= 2.45d-27) then
tmp = x
else
tmp = x / (z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (y <= -2e+84) {
tmp = t_0;
} else if (y <= -2.9e+48) {
tmp = x;
} else if (y <= -150000000000.0) {
tmp = t_0;
} else if (y <= 2.45e-27) {
tmp = x;
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z): t_0 = x * (y / z) tmp = 0 if y <= -2e+84: tmp = t_0 elif y <= -2.9e+48: tmp = x elif y <= -150000000000.0: tmp = t_0 elif y <= 2.45e-27: tmp = x else: tmp = x / (z / y) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(y / z)) tmp = 0.0 if (y <= -2e+84) tmp = t_0; elseif (y <= -2.9e+48) tmp = x; elseif (y <= -150000000000.0) tmp = t_0; elseif (y <= 2.45e-27) tmp = x; else tmp = Float64(x / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (y / z); tmp = 0.0; if (y <= -2e+84) tmp = t_0; elseif (y <= -2.9e+48) tmp = x; elseif (y <= -150000000000.0) tmp = t_0; elseif (y <= 2.45e-27) tmp = x; else tmp = x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e+84], t$95$0, If[LessEqual[y, -2.9e+48], x, If[LessEqual[y, -150000000000.0], t$95$0, If[LessEqual[y, 2.45e-27], x, N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -2 \cdot 10^{+84}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{+48}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -150000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -2.00000000000000012e84 or -2.8999999999999999e48 < y < -1.5e11Initial program 89.2%
associate-*l/88.4%
*-commutative88.4%
Simplified88.4%
Taylor expanded in y around inf 77.0%
associate-*r/79.6%
Simplified79.6%
if -2.00000000000000012e84 < y < -2.8999999999999999e48 or -1.5e11 < y < 2.44999999999999988e-27Initial program 79.3%
associate-*l/85.0%
*-commutative85.0%
Simplified85.0%
Taylor expanded in y around 0 84.7%
if 2.44999999999999988e-27 < y Initial program 94.6%
associate-*l/86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in y around inf 83.8%
associate-*r/76.5%
Simplified76.5%
associate-*r/83.8%
associate-/l*76.6%
Applied egg-rr76.6%
Final simplification81.3%
(FPCore (x y z) :precision binary64 (if (<= y 6e+58) (* x (+ (/ y z) 1.0)) (/ (* x (+ y z)) z)))
double code(double x, double y, double z) {
double tmp;
if (y <= 6e+58) {
tmp = x * ((y / z) + 1.0);
} else {
tmp = (x * (y + z)) / 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 <= 6d+58) then
tmp = x * ((y / z) + 1.0d0)
else
tmp = (x * (y + z)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 6e+58) {
tmp = x * ((y / z) + 1.0);
} else {
tmp = (x * (y + z)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 6e+58: tmp = x * ((y / z) + 1.0) else: tmp = (x * (y + z)) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= 6e+58) tmp = Float64(x * Float64(Float64(y / z) + 1.0)); else tmp = Float64(Float64(x * Float64(y + z)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 6e+58) tmp = x * ((y / z) + 1.0); else tmp = (x * (y + z)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 6e+58], N[(x * N[(N[(y / z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6 \cdot 10^{+58}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y + z\right)}{z}\\
\end{array}
\end{array}
if y < 6.0000000000000005e58Initial program 83.3%
remove-double-neg83.3%
distribute-lft-neg-out83.3%
*-commutative83.3%
distribute-lft-neg-in83.3%
associate-/l*84.2%
distribute-neg-in84.2%
unsub-neg84.2%
div-sub79.8%
distribute-frac-neg79.8%
associate-/r/81.0%
distribute-rgt-neg-out81.0%
remove-double-neg81.0%
associate-/r/99.0%
*-inverses99.0%
*-lft-identity99.0%
*-commutative99.0%
fma-neg99.0%
remove-double-neg99.0%
Simplified99.0%
Taylor expanded in x around 0 99.0%
if 6.0000000000000005e58 < y Initial program 96.1%
Final simplification98.4%
(FPCore (x y z) :precision binary64 (* x (+ (/ y z) 1.0)))
double code(double x, double y, double z) {
return x * ((y / z) + 1.0);
}
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 / z) + 1.0d0)
end function
public static double code(double x, double y, double z) {
return x * ((y / z) + 1.0);
}
def code(x, y, z): return x * ((y / z) + 1.0)
function code(x, y, z) return Float64(x * Float64(Float64(y / z) + 1.0)) end
function tmp = code(x, y, z) tmp = x * ((y / z) + 1.0); end
code[x_, y_, z_] := N[(x * N[(N[(y / z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} + 1\right)
\end{array}
Initial program 85.7%
remove-double-neg85.7%
distribute-lft-neg-out85.7%
*-commutative85.7%
distribute-lft-neg-in85.7%
associate-/l*85.3%
distribute-neg-in85.3%
unsub-neg85.3%
div-sub80.2%
distribute-frac-neg80.2%
associate-/r/79.7%
distribute-rgt-neg-out79.7%
remove-double-neg79.7%
associate-/r/96.6%
*-inverses96.6%
*-lft-identity96.6%
*-commutative96.6%
fma-neg96.6%
remove-double-neg96.6%
Simplified96.6%
Taylor expanded in x around 0 96.6%
Final simplification96.6%
(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}
Initial program 85.7%
associate-*l/86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in y around 0 50.5%
Final simplification50.5%
(FPCore (x y z) :precision binary64 (/ x (/ z (+ y z))))
double code(double x, double y, double z) {
return x / (z / (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 / (z / (y + z))
end function
public static double code(double x, double y, double z) {
return x / (z / (y + z));
}
def code(x, y, z): return x / (z / (y + z))
function code(x, y, z) return Float64(x / Float64(z / Float64(y + z))) end
function tmp = code(x, y, z) tmp = x / (z / (y + z)); end
code[x_, y_, z_] := N[(x / N[(z / N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{z}{y + z}}
\end{array}
herbie shell --seed 2024021
(FPCore (x y z)
:name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(/ x (/ z (+ y z)))
(/ (* x (+ y z)) z))