
(FPCore (x y z) :precision binary64 (/ (+ x (* y (- z x))) z))
double code(double x, double y, double z) {
return (x + (y * (z - x))) / 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 - x))) / z
end function
public static double code(double x, double y, double z) {
return (x + (y * (z - x))) / z;
}
def code(x, y, z): return (x + (y * (z - x))) / z
function code(x, y, z) return Float64(Float64(x + Float64(y * Float64(z - x))) / z) end
function tmp = code(x, y, z) tmp = (x + (y * (z - x))) / z; end
code[x_, y_, z_] := N[(N[(x + N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y \cdot \left(z - x\right)}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (+ x (* y (- z x))) z))
double code(double x, double y, double z) {
return (x + (y * (z - x))) / 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 - x))) / z
end function
public static double code(double x, double y, double z) {
return (x + (y * (z - x))) / z;
}
def code(x, y, z): return (x + (y * (z - x))) / z
function code(x, y, z) return Float64(Float64(x + Float64(y * Float64(z - x))) / z) end
function tmp = code(x, y, z) tmp = (x + (y * (z - x))) / z; end
code[x_, y_, z_] := N[(N[(x + N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y \cdot \left(z - x\right)}{z}
\end{array}
(FPCore (x y z) :precision binary64 (+ y (* (/ x z) (- 1.0 y))))
double code(double x, double y, double z) {
return y + ((x / z) * (1.0 - y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y + ((x / z) * (1.0d0 - y))
end function
public static double code(double x, double y, double z) {
return y + ((x / z) * (1.0 - y));
}
def code(x, y, z): return y + ((x / z) * (1.0 - y))
function code(x, y, z) return Float64(y + Float64(Float64(x / z) * Float64(1.0 - y))) end
function tmp = code(x, y, z) tmp = y + ((x / z) * (1.0 - y)); end
code[x_, y_, z_] := N[(y + N[(N[(x / z), $MachinePrecision] * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y + \frac{x}{z} \cdot \left(1 - y\right)
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ (- x) z))))
(if (<= y -1.25e+220)
y
(if (<= y -1.0)
t_0
(if (<= y -2.65e-52)
(/ x z)
(if (<= y -4.8e-105)
y
(if (<= y 2.2e-17)
(/ x z)
(if (<= y 6.6e+62) y (if (<= y 2.5e+304) t_0 y)))))))))
double code(double x, double y, double z) {
double t_0 = y * (-x / z);
double tmp;
if (y <= -1.25e+220) {
tmp = y;
} else if (y <= -1.0) {
tmp = t_0;
} else if (y <= -2.65e-52) {
tmp = x / z;
} else if (y <= -4.8e-105) {
tmp = y;
} else if (y <= 2.2e-17) {
tmp = x / z;
} else if (y <= 6.6e+62) {
tmp = y;
} else if (y <= 2.5e+304) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = y * (-x / z)
if (y <= (-1.25d+220)) then
tmp = y
else if (y <= (-1.0d0)) then
tmp = t_0
else if (y <= (-2.65d-52)) then
tmp = x / z
else if (y <= (-4.8d-105)) then
tmp = y
else if (y <= 2.2d-17) then
tmp = x / z
else if (y <= 6.6d+62) then
tmp = y
else if (y <= 2.5d+304) then
tmp = t_0
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (-x / z);
double tmp;
if (y <= -1.25e+220) {
tmp = y;
} else if (y <= -1.0) {
tmp = t_0;
} else if (y <= -2.65e-52) {
tmp = x / z;
} else if (y <= -4.8e-105) {
tmp = y;
} else if (y <= 2.2e-17) {
tmp = x / z;
} else if (y <= 6.6e+62) {
tmp = y;
} else if (y <= 2.5e+304) {
tmp = t_0;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): t_0 = y * (-x / z) tmp = 0 if y <= -1.25e+220: tmp = y elif y <= -1.0: tmp = t_0 elif y <= -2.65e-52: tmp = x / z elif y <= -4.8e-105: tmp = y elif y <= 2.2e-17: tmp = x / z elif y <= 6.6e+62: tmp = y elif y <= 2.5e+304: tmp = t_0 else: tmp = y return tmp
function code(x, y, z) t_0 = Float64(y * Float64(Float64(-x) / z)) tmp = 0.0 if (y <= -1.25e+220) tmp = y; elseif (y <= -1.0) tmp = t_0; elseif (y <= -2.65e-52) tmp = Float64(x / z); elseif (y <= -4.8e-105) tmp = y; elseif (y <= 2.2e-17) tmp = Float64(x / z); elseif (y <= 6.6e+62) tmp = y; elseif (y <= 2.5e+304) tmp = t_0; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (-x / z); tmp = 0.0; if (y <= -1.25e+220) tmp = y; elseif (y <= -1.0) tmp = t_0; elseif (y <= -2.65e-52) tmp = x / z; elseif (y <= -4.8e-105) tmp = y; elseif (y <= 2.2e-17) tmp = x / z; elseif (y <= 6.6e+62) tmp = y; elseif (y <= 2.5e+304) tmp = t_0; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[((-x) / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.25e+220], y, If[LessEqual[y, -1.0], t$95$0, If[LessEqual[y, -2.65e-52], N[(x / z), $MachinePrecision], If[LessEqual[y, -4.8e-105], y, If[LessEqual[y, 2.2e-17], N[(x / z), $MachinePrecision], If[LessEqual[y, 6.6e+62], y, If[LessEqual[y, 2.5e+304], t$95$0, y]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{-x}{z}\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{+220}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq -1:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -2.65 \cdot 10^{-52}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{-105}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+62}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+304}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(if (or (<= z -2.7e-40)
(not (or (<= z 9e-62) (and (not (<= z 6.5e-10)) (<= z 1.7e+54)))))
(+ y (/ x z))
(* (/ x z) (- 1.0 y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.7e-40) || !((z <= 9e-62) || (!(z <= 6.5e-10) && (z <= 1.7e+54)))) {
tmp = y + (x / z);
} else {
tmp = (x / z) * (1.0 - 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 ((z <= (-2.7d-40)) .or. (.not. (z <= 9d-62) .or. (.not. (z <= 6.5d-10)) .and. (z <= 1.7d+54))) then
tmp = y + (x / z)
else
tmp = (x / z) * (1.0d0 - y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.7e-40) || !((z <= 9e-62) || (!(z <= 6.5e-10) && (z <= 1.7e+54)))) {
tmp = y + (x / z);
} else {
tmp = (x / z) * (1.0 - y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.7e-40) or not ((z <= 9e-62) or (not (z <= 6.5e-10) and (z <= 1.7e+54))): tmp = y + (x / z) else: tmp = (x / z) * (1.0 - y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.7e-40) || !((z <= 9e-62) || (!(z <= 6.5e-10) && (z <= 1.7e+54)))) tmp = Float64(y + Float64(x / z)); else tmp = Float64(Float64(x / z) * Float64(1.0 - y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.7e-40) || ~(((z <= 9e-62) || (~((z <= 6.5e-10)) && (z <= 1.7e+54))))) tmp = y + (x / z); else tmp = (x / z) * (1.0 - y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.7e-40], N[Not[Or[LessEqual[z, 9e-62], And[N[Not[LessEqual[z, 6.5e-10]], $MachinePrecision], LessEqual[z, 1.7e+54]]]], $MachinePrecision]], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-40} \lor \neg \left(z \leq 9 \cdot 10^{-62} \lor \neg \left(z \leq 6.5 \cdot 10^{-10}\right) \land z \leq 1.7 \cdot 10^{+54}\right):\\
\;\;\;\;y + \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(1 - y\right)\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= y -5.4e+185)
y
(if (<= y -1.0)
(* (- x) (/ y z))
(if (or (<= y -1.68e-53) (and (not (<= y -1.45e-105)) (<= y 2.4e-17)))
(/ x z)
y))))
double code(double x, double y, double z) {
double tmp;
if (y <= -5.4e+185) {
tmp = y;
} else if (y <= -1.0) {
tmp = -x * (y / z);
} else if ((y <= -1.68e-53) || (!(y <= -1.45e-105) && (y <= 2.4e-17))) {
tmp = x / z;
} 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 <= (-5.4d+185)) then
tmp = y
else if (y <= (-1.0d0)) then
tmp = -x * (y / z)
else if ((y <= (-1.68d-53)) .or. (.not. (y <= (-1.45d-105))) .and. (y <= 2.4d-17)) then
tmp = x / z
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -5.4e+185) {
tmp = y;
} else if (y <= -1.0) {
tmp = -x * (y / z);
} else if ((y <= -1.68e-53) || (!(y <= -1.45e-105) && (y <= 2.4e-17))) {
tmp = x / z;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5.4e+185: tmp = y elif y <= -1.0: tmp = -x * (y / z) elif (y <= -1.68e-53) or (not (y <= -1.45e-105) and (y <= 2.4e-17)): tmp = x / z else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5.4e+185) tmp = y; elseif (y <= -1.0) tmp = Float64(Float64(-x) * Float64(y / z)); elseif ((y <= -1.68e-53) || (!(y <= -1.45e-105) && (y <= 2.4e-17))) tmp = Float64(x / z); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -5.4e+185) tmp = y; elseif (y <= -1.0) tmp = -x * (y / z); elseif ((y <= -1.68e-53) || (~((y <= -1.45e-105)) && (y <= 2.4e-17))) tmp = x / z; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5.4e+185], y, If[LessEqual[y, -1.0], N[((-x) * N[(y / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -1.68e-53], And[N[Not[LessEqual[y, -1.45e-105]], $MachinePrecision], LessEqual[y, 2.4e-17]]], N[(x / z), $MachinePrecision], y]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.4 \cdot 10^{+185}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq -1:\\
\;\;\;\;\left(-x\right) \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq -1.68 \cdot 10^{-53} \lor \neg \left(y \leq -1.45 \cdot 10^{-105}\right) \land y \leq 2.4 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= y -0.0003)
y
(if (or (<= y -6.8e-54) (and (not (<= y -4e-109)) (<= y 1.6e-17)))
(/ x z)
y)))
double code(double x, double y, double z) {
double tmp;
if (y <= -0.0003) {
tmp = y;
} else if ((y <= -6.8e-54) || (!(y <= -4e-109) && (y <= 1.6e-17))) {
tmp = x / z;
} 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 <= (-0.0003d0)) then
tmp = y
else if ((y <= (-6.8d-54)) .or. (.not. (y <= (-4d-109))) .and. (y <= 1.6d-17)) then
tmp = x / z
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -0.0003) {
tmp = y;
} else if ((y <= -6.8e-54) || (!(y <= -4e-109) && (y <= 1.6e-17))) {
tmp = x / z;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -0.0003: tmp = y elif (y <= -6.8e-54) or (not (y <= -4e-109) and (y <= 1.6e-17)): tmp = x / z else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -0.0003) tmp = y; elseif ((y <= -6.8e-54) || (!(y <= -4e-109) && (y <= 1.6e-17))) tmp = Float64(x / z); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -0.0003) tmp = y; elseif ((y <= -6.8e-54) || (~((y <= -4e-109)) && (y <= 1.6e-17))) tmp = x / z; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -0.0003], y, If[Or[LessEqual[y, -6.8e-54], And[N[Not[LessEqual[y, -4e-109]], $MachinePrecision], LessEqual[y, 1.6e-17]]], N[(x / z), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0003:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq -6.8 \cdot 10^{-54} \lor \neg \left(y \leq -4 \cdot 10^{-109}\right) \land y \leq 1.6 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= y -1.0) (not (<= y 0.0152))) (* (/ y z) (- z x)) (+ y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.0) || !(y <= 0.0152)) {
tmp = (y / z) * (z - 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 <= (-1.0d0)) .or. (.not. (y <= 0.0152d0))) then
tmp = (y / z) * (z - 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 <= -1.0) || !(y <= 0.0152)) {
tmp = (y / z) * (z - x);
} else {
tmp = y + (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.0) or not (y <= 0.0152): tmp = (y / z) * (z - x) else: tmp = y + (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.0) || !(y <= 0.0152)) tmp = Float64(Float64(y / z) * Float64(z - x)); else tmp = Float64(y + Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.0) || ~((y <= 0.0152))) tmp = (y / z) * (z - x); else tmp = y + (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 0.0152]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] * N[(z - x), $MachinePrecision]), $MachinePrecision], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 0.0152\right):\\
\;\;\;\;\frac{y}{z} \cdot \left(z - x\right)\\
\mathbf{else}:\\
\;\;\;\;y + \frac{x}{z}\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= y -1.0) (not (<= y 0.00012))) (- y (/ y (/ z x))) (+ y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.0) || !(y <= 0.00012)) {
tmp = y - (y / (z / 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 <= (-1.0d0)) .or. (.not. (y <= 0.00012d0))) then
tmp = y - (y / (z / 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 <= -1.0) || !(y <= 0.00012)) {
tmp = y - (y / (z / x));
} else {
tmp = y + (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.0) or not (y <= 0.00012): tmp = y - (y / (z / x)) else: tmp = y + (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.0) || !(y <= 0.00012)) tmp = Float64(y - Float64(y / Float64(z / x))); else tmp = Float64(y + Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.0) || ~((y <= 0.00012))) tmp = y - (y / (z / x)); else tmp = y + (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 0.00012]], $MachinePrecision]], N[(y - N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 0.00012\right):\\
\;\;\;\;y - \frac{y}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;y + \frac{x}{z}\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= y 1.08e+66) (+ y (/ x z)) (* y (/ (- x) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.08e+66) {
tmp = y + (x / z);
} 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 <= 1.08d+66) then
tmp = y + (x / z)
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 <= 1.08e+66) {
tmp = y + (x / z);
} else {
tmp = y * (-x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.08e+66: tmp = y + (x / z) else: tmp = y * (-x / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.08e+66) tmp = Float64(y + Float64(x / z)); else tmp = Float64(y * Float64(Float64(-x) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 1.08e+66) tmp = y + (x / z); else tmp = y * (-x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.08e+66], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], N[(y * N[((-x) / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.08 \cdot 10^{+66}:\\
\;\;\;\;y + \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-x}{z}\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 y)
double code(double x, double y, double z) {
return y;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y
end function
public static double code(double x, double y, double z) {
return y;
}
def code(x, y, z): return y
function code(x, y, z) return y end
function tmp = code(x, y, z) tmp = y; end
code[x_, y_, z_] := y
\begin{array}{l}
\\
y
\end{array}
(FPCore (x y z) :precision binary64 (- (+ y (/ x z)) (/ y (/ z x))))
double code(double x, double y, double z) {
return (y + (x / z)) - (y / (z / x));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (y + (x / z)) - (y / (z / x))
end function
public static double code(double x, double y, double z) {
return (y + (x / z)) - (y / (z / x));
}
def code(x, y, z): return (y + (x / z)) - (y / (z / x))
function code(x, y, z) return Float64(Float64(y + Float64(x / z)) - Float64(y / Float64(z / x))) end
function tmp = code(x, y, z) tmp = (y + (x / z)) - (y / (z / x)); end
code[x_, y_, z_] := N[(N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision] - N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y + \frac{x}{z}\right) - \frac{y}{\frac{z}{x}}
\end{array}
herbie shell --seed 2024010
(FPCore (x y z)
:name "Diagrams.Backend.Rasterific:rasterificRadialGradient from diagrams-rasterific-1.3.1.3"
:precision binary64
:herbie-target
(- (+ y (/ x z)) (/ y (/ z x)))
(/ (+ x (* y (- z x))) z))