
(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 (if (or (<= y -7.1e+56) (not (<= y 900000000.0))) (* y (/ (- z x) z)) (/ (+ x (* y (- z x))) z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -7.1e+56) || !(y <= 900000000.0)) {
tmp = y * ((z - x) / z);
} else {
tmp = (x + (y * (z - 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 <= (-7.1d+56)) .or. (.not. (y <= 900000000.0d0))) then
tmp = y * ((z - x) / z)
else
tmp = (x + (y * (z - x))) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -7.1e+56) || !(y <= 900000000.0)) {
tmp = y * ((z - x) / z);
} else {
tmp = (x + (y * (z - x))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -7.1e+56) or not (y <= 900000000.0): tmp = y * ((z - x) / z) else: tmp = (x + (y * (z - x))) / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -7.1e+56) || !(y <= 900000000.0)) tmp = Float64(y * Float64(Float64(z - x) / z)); else tmp = Float64(Float64(x + Float64(y * Float64(z - x))) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -7.1e+56) || ~((y <= 900000000.0))) tmp = y * ((z - x) / z); else tmp = (x + (y * (z - x))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -7.1e+56], N[Not[LessEqual[y, 900000000.0]], $MachinePrecision]], N[(y * N[(N[(z - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.1 \cdot 10^{+56} \lor \neg \left(y \leq 900000000\right):\\
\;\;\;\;y \cdot \frac{z - x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \left(z - x\right)}{z}\\
\end{array}
\end{array}
if y < -7.1e56 or 9e8 < y Initial program 70.8%
Taylor expanded in y around inf 70.8%
associate-/l*99.9%
Simplified99.9%
if -7.1e56 < y < 9e8Initial program 100.0%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ y (/ x z))))
(if (<= y -1.25e+228)
t_0
(if (<= y -8e+129) (/ y (/ (- z) x)) (if (<= y 1.0) t_0 (- y (/ x z)))))))
double code(double x, double y, double z) {
double t_0 = y + (x / z);
double tmp;
if (y <= -1.25e+228) {
tmp = t_0;
} else if (y <= -8e+129) {
tmp = y / (-z / x);
} else if (y <= 1.0) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = y + (x / z)
if (y <= (-1.25d+228)) then
tmp = t_0
else if (y <= (-8d+129)) then
tmp = y / (-z / x)
else if (y <= 1.0d0) then
tmp = t_0
else
tmp = y - (x / z)
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+228) {
tmp = t_0;
} else if (y <= -8e+129) {
tmp = y / (-z / x);
} else if (y <= 1.0) {
tmp = t_0;
} else {
tmp = y - (x / z);
}
return tmp;
}
def code(x, y, z): t_0 = y + (x / z) tmp = 0 if y <= -1.25e+228: tmp = t_0 elif y <= -8e+129: tmp = y / (-z / x) elif y <= 1.0: tmp = t_0 else: tmp = y - (x / z) return tmp
function code(x, y, z) t_0 = Float64(y + Float64(x / z)) tmp = 0.0 if (y <= -1.25e+228) tmp = t_0; elseif (y <= -8e+129) tmp = Float64(y / Float64(Float64(-z) / x)); elseif (y <= 1.0) tmp = t_0; else tmp = Float64(y - Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y + (x / z); tmp = 0.0; if (y <= -1.25e+228) tmp = t_0; elseif (y <= -8e+129) tmp = y / (-z / x); elseif (y <= 1.0) tmp = t_0; else tmp = y - (x / z); 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+228], t$95$0, If[LessEqual[y, -8e+129], N[(y / N[((-z) / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0], t$95$0, N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y + \frac{x}{z}\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{+228}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -8 \cdot 10^{+129}:\\
\;\;\;\;\frac{y}{\frac{-z}{x}}\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;y - \frac{x}{z}\\
\end{array}
\end{array}
if y < -1.25e228 or -8e129 < y < 1Initial program 94.5%
Taylor expanded in z around inf 90.3%
Taylor expanded in x around 0 94.2%
if -1.25e228 < y < -8e129Initial program 76.6%
Taylor expanded in x around inf 76.4%
mul-1-neg76.4%
unsub-neg76.4%
Simplified76.4%
Taylor expanded in y around inf 76.4%
neg-mul-176.4%
Simplified76.4%
Taylor expanded in x around 0 76.4%
mul-1-neg76.4%
distribute-frac-neg276.4%
*-commutative76.4%
associate-*r/85.6%
Simplified85.6%
distribute-frac-neg285.6%
distribute-rgt-neg-out85.6%
clear-num85.7%
un-div-inv85.9%
Applied egg-rr85.9%
if 1 < y Initial program 72.1%
Taylor expanded in z around inf 36.6%
Taylor expanded in x around 0 58.9%
add-sqr-sqrt22.7%
sqrt-unprod63.3%
sqr-neg63.3%
sqrt-unprod37.8%
add-sqr-sqrt73.0%
distribute-frac-neg273.0%
sub-neg73.0%
Applied egg-rr73.0%
Final simplification88.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -9000000000000.0) (not (<= y 1.0))) (* y (/ (- z x) z)) (+ y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -9000000000000.0) || !(y <= 1.0)) {
tmp = y * ((z - 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 <= (-9000000000000.0d0)) .or. (.not. (y <= 1.0d0))) then
tmp = y * ((z - 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 <= -9000000000000.0) || !(y <= 1.0)) {
tmp = y * ((z - x) / z);
} else {
tmp = y + (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -9000000000000.0) or not (y <= 1.0): tmp = y * ((z - x) / z) else: tmp = y + (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -9000000000000.0) || !(y <= 1.0)) tmp = Float64(y * Float64(Float64(z - x) / z)); else tmp = Float64(y + Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -9000000000000.0) || ~((y <= 1.0))) tmp = y * ((z - x) / z); else tmp = y + (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -9000000000000.0], N[Not[LessEqual[y, 1.0]], $MachinePrecision]], N[(y * N[(N[(z - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9000000000000 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;y \cdot \frac{z - x}{z}\\
\mathbf{else}:\\
\;\;\;\;y + \frac{x}{z}\\
\end{array}
\end{array}
if y < -9e12 or 1 < y Initial program 72.3%
Taylor expanded in y around inf 71.9%
associate-/l*99.4%
Simplified99.4%
if -9e12 < y < 1Initial program 100.0%
Taylor expanded in z around inf 98.9%
Taylor expanded in x around 0 99.0%
Final simplification99.2%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.35e+193) (not (<= x 3.4e+63))) (* x (/ (- 1.0 y) z)) (+ y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.35e+193) || !(x <= 3.4e+63)) {
tmp = x * ((1.0 - y) / 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 ((x <= (-1.35d+193)) .or. (.not. (x <= 3.4d+63))) then
tmp = x * ((1.0d0 - y) / 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 ((x <= -1.35e+193) || !(x <= 3.4e+63)) {
tmp = x * ((1.0 - y) / z);
} else {
tmp = y + (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.35e+193) or not (x <= 3.4e+63): tmp = x * ((1.0 - y) / z) else: tmp = y + (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.35e+193) || !(x <= 3.4e+63)) tmp = Float64(x * Float64(Float64(1.0 - y) / z)); else tmp = Float64(y + Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.35e+193) || ~((x <= 3.4e+63))) tmp = x * ((1.0 - y) / z); else tmp = y + (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.35e+193], N[Not[LessEqual[x, 3.4e+63]], $MachinePrecision]], N[(x * N[(N[(1.0 - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+193} \lor \neg \left(x \leq 3.4 \cdot 10^{+63}\right):\\
\;\;\;\;x \cdot \frac{1 - y}{z}\\
\mathbf{else}:\\
\;\;\;\;y + \frac{x}{z}\\
\end{array}
\end{array}
if x < -1.35e193 or 3.3999999999999999e63 < x Initial program 85.4%
Taylor expanded in x around inf 85.4%
associate-/l*93.2%
mul-1-neg93.2%
unsub-neg93.2%
Simplified93.2%
if -1.35e193 < x < 3.3999999999999999e63Initial program 87.9%
Taylor expanded in z around inf 75.0%
Taylor expanded in x around 0 86.1%
Final simplification88.1%
(FPCore (x y z) :precision binary64 (if (or (<= y -5.5e-5) (not (<= y 9.5e-26))) (* z (/ y z)) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -5.5e-5) || !(y <= 9.5e-26)) {
tmp = z * (y / z);
} else {
tmp = 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 <= (-5.5d-5)) .or. (.not. (y <= 9.5d-26))) then
tmp = z * (y / z)
else
tmp = x / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -5.5e-5) || !(y <= 9.5e-26)) {
tmp = z * (y / z);
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -5.5e-5) or not (y <= 9.5e-26): tmp = z * (y / z) else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -5.5e-5) || !(y <= 9.5e-26)) tmp = Float64(z * Float64(y / z)); else tmp = Float64(x / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -5.5e-5) || ~((y <= 9.5e-26))) tmp = z * (y / z); else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -5.5e-5], N[Not[LessEqual[y, 9.5e-26]], $MachinePrecision]], N[(z * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{-5} \lor \neg \left(y \leq 9.5 \cdot 10^{-26}\right):\\
\;\;\;\;z \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if y < -5.5000000000000002e-5 or 9.4999999999999995e-26 < y Initial program 74.3%
Taylor expanded in y around inf 74.3%
Taylor expanded in z around inf 36.0%
*-commutative36.0%
associate-/l*61.7%
Applied egg-rr61.7%
if -5.5000000000000002e-5 < y < 9.4999999999999995e-26Initial program 100.0%
Taylor expanded in y around 0 72.3%
Final simplification67.1%
(FPCore (x y z) :precision binary64 (if (<= z -9.6e-58) y (if (<= z 3.3e+49) (/ x z) y)))
double code(double x, double y, double z) {
double tmp;
if (z <= -9.6e-58) {
tmp = y;
} else if (z <= 3.3e+49) {
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 (z <= (-9.6d-58)) then
tmp = y
else if (z <= 3.3d+49) 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 (z <= -9.6e-58) {
tmp = y;
} else if (z <= 3.3e+49) {
tmp = x / z;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -9.6e-58: tmp = y elif z <= 3.3e+49: tmp = x / z else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if (z <= -9.6e-58) tmp = y; elseif (z <= 3.3e+49) tmp = Float64(x / z); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -9.6e-58) tmp = y; elseif (z <= 3.3e+49) tmp = x / z; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -9.6e-58], y, If[LessEqual[z, 3.3e+49], N[(x / z), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.6 \cdot 10^{-58}:\\
\;\;\;\;y\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+49}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if z < -9.6000000000000002e-58 or 3.2999999999999998e49 < z Initial program 77.7%
Taylor expanded in x around 0 67.1%
if -9.6000000000000002e-58 < z < 3.2999999999999998e49Initial program 97.7%
Taylor expanded in y around 0 61.5%
(FPCore (x y z) :precision binary64 (if (<= y 1.0) (+ y (/ x z)) (- y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.0) {
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.0d0) 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.0) {
tmp = y + (x / z);
} else {
tmp = y - (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.0: tmp = y + (x / z) else: tmp = y - (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.0) tmp = Float64(y + Float64(x / z)); 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) tmp = y + (x / z); else tmp = y - (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.0], 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:\\
\;\;\;\;y + \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y - \frac{x}{z}\\
\end{array}
\end{array}
if y < 1Initial program 92.6%
Taylor expanded in z around inf 84.2%
Taylor expanded in x around 0 88.7%
if 1 < y Initial program 72.1%
Taylor expanded in z around inf 36.6%
Taylor expanded in x around 0 58.9%
add-sqr-sqrt22.7%
sqrt-unprod63.3%
sqr-neg63.3%
sqrt-unprod37.8%
add-sqr-sqrt73.0%
distribute-frac-neg273.0%
sub-neg73.0%
Applied egg-rr73.0%
(FPCore (x y z) :precision binary64 (if (<= y 1.0) (+ y (/ x z)) (* z (/ y z))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.0) {
tmp = y + (x / z);
} else {
tmp = z * (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 <= 1.0d0) then
tmp = y + (x / z)
else
tmp = z * (y / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 1.0) {
tmp = y + (x / z);
} else {
tmp = z * (y / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.0: tmp = y + (x / z) else: tmp = z * (y / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.0) tmp = Float64(y + Float64(x / z)); else tmp = Float64(z * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 1.0) tmp = y + (x / z); else tmp = z * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.0], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], N[(z * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;y + \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < 1Initial program 92.6%
Taylor expanded in z around inf 84.2%
Taylor expanded in x around 0 88.7%
if 1 < y Initial program 72.1%
Taylor expanded in y around inf 72.1%
Taylor expanded in z around inf 37.4%
*-commutative37.4%
associate-/l*66.8%
Applied egg-rr66.8%
(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}
Initial program 87.2%
Taylor expanded in x around 0 41.8%
(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 2024139
(FPCore (x y z)
:name "Diagrams.Backend.Rasterific:rasterificRadialGradient from diagrams-rasterific-1.3.1.3"
:precision binary64
:alt
(! :herbie-platform default (- (+ y (/ x z)) (/ y (/ z x))))
(/ (+ x (* y (- z x))) z))