
(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 10 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 -1.0) (not (<= y 1.0))) (* y (/ (- z x) z)) (+ y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.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 <= (-1.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 <= -1.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 <= -1.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 <= -1.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 <= -1.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, -1.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 -1 \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 < -1 or 1 < y Initial program 71.9%
Taylor expanded in y around inf 69.9%
associate-/l*97.9%
Simplified97.9%
if -1 < y < 1Initial program 99.9%
Taylor expanded in x around inf 99.8%
associate-+r+99.8%
+-commutative99.8%
mul-1-neg99.8%
unsub-neg99.8%
div-sub99.8%
Simplified99.8%
Taylor expanded in z around inf 100.0%
Taylor expanded in y around 0 99.4%
Final simplification98.6%
(FPCore (x y z) :precision binary64 (if (or (<= x -2.5e+88) (not (<= x 4.4e-24))) (* x (/ (- 1.0 y) z)) (+ y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.5e+88) || !(x <= 4.4e-24)) {
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 <= (-2.5d+88)) .or. (.not. (x <= 4.4d-24))) 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 <= -2.5e+88) || !(x <= 4.4e-24)) {
tmp = x * ((1.0 - y) / z);
} else {
tmp = y + (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.5e+88) or not (x <= 4.4e-24): tmp = x * ((1.0 - y) / z) else: tmp = y + (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.5e+88) || !(x <= 4.4e-24)) 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 <= -2.5e+88) || ~((x <= 4.4e-24))) tmp = x * ((1.0 - y) / z); else tmp = y + (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.5e+88], N[Not[LessEqual[x, 4.4e-24]], $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 -2.5 \cdot 10^{+88} \lor \neg \left(x \leq 4.4 \cdot 10^{-24}\right):\\
\;\;\;\;x \cdot \frac{1 - y}{z}\\
\mathbf{else}:\\
\;\;\;\;y + \frac{x}{z}\\
\end{array}
\end{array}
if x < -2.49999999999999999e88 or 4.40000000000000003e-24 < x Initial program 88.1%
Taylor expanded in x around inf 83.3%
associate-/l*88.5%
mul-1-neg88.5%
unsub-neg88.5%
Simplified88.5%
if -2.49999999999999999e88 < x < 4.40000000000000003e-24Initial program 81.8%
Taylor expanded in x around inf 72.6%
associate-+r+72.6%
+-commutative72.6%
mul-1-neg72.6%
unsub-neg72.6%
div-sub72.6%
Simplified72.6%
Taylor expanded in z around inf 97.7%
Taylor expanded in y around 0 85.2%
Final simplification86.9%
(FPCore (x y z) :precision binary64 (if (<= y -1e+45) (* y (/ (- z x) z)) (+ y (/ (* x (- 1.0 y)) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1e+45) {
tmp = y * ((z - x) / z);
} else {
tmp = y + ((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 <= (-1d+45)) then
tmp = y * ((z - x) / z)
else
tmp = y + ((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 <= -1e+45) {
tmp = y * ((z - x) / z);
} else {
tmp = y + ((x * (1.0 - y)) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1e+45: tmp = y * ((z - x) / z) else: tmp = y + ((x * (1.0 - y)) / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1e+45) tmp = Float64(y * Float64(Float64(z - x) / z)); else tmp = Float64(y + Float64(Float64(x * Float64(1.0 - y)) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1e+45) tmp = y * ((z - x) / z); else tmp = y + ((x * (1.0 - y)) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1e+45], N[(y * N[(N[(z - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y + N[(N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+45}:\\
\;\;\;\;y \cdot \frac{z - x}{z}\\
\mathbf{else}:\\
\;\;\;\;y + \frac{x \cdot \left(1 - y\right)}{z}\\
\end{array}
\end{array}
if y < -9.9999999999999993e44Initial program 56.7%
Taylor expanded in y around inf 56.7%
associate-/l*99.9%
Simplified99.9%
if -9.9999999999999993e44 < y Initial program 92.5%
Taylor expanded in x around inf 89.5%
associate-+r+89.5%
+-commutative89.5%
mul-1-neg89.5%
unsub-neg89.5%
div-sub89.5%
Simplified89.5%
Taylor expanded in z around inf 98.1%
(FPCore (x y z) :precision binary64 (if (<= y -2e+110) (* y (/ (- z x) z)) (+ y (* x (/ (- 1.0 y) z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2e+110) {
tmp = y * ((z - x) / z);
} else {
tmp = y + (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 <= (-2d+110)) then
tmp = y * ((z - x) / z)
else
tmp = y + (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 <= -2e+110) {
tmp = y * ((z - x) / z);
} else {
tmp = y + (x * ((1.0 - y) / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2e+110: tmp = y * ((z - x) / z) else: tmp = y + (x * ((1.0 - y) / z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2e+110) tmp = Float64(y * Float64(Float64(z - x) / z)); else tmp = Float64(y + Float64(x * Float64(Float64(1.0 - y) / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2e+110) tmp = y * ((z - x) / z); else tmp = y + (x * ((1.0 - y) / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2e+110], N[(y * N[(N[(z - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y + N[(x * N[(N[(1.0 - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+110}:\\
\;\;\;\;y \cdot \frac{z - x}{z}\\
\mathbf{else}:\\
\;\;\;\;y + x \cdot \frac{1 - y}{z}\\
\end{array}
\end{array}
if y < -2e110Initial program 54.6%
Taylor expanded in y around inf 54.6%
associate-/l*100.0%
Simplified100.0%
if -2e110 < y Initial program 90.7%
Taylor expanded in x around inf 89.7%
associate-+r+89.7%
+-commutative89.7%
mul-1-neg89.7%
unsub-neg89.7%
div-sub89.7%
Simplified89.7%
Taylor expanded in z around inf 96.9%
associate-*r/98.1%
*-commutative98.1%
Applied egg-rr98.1%
Final simplification98.4%
(FPCore (x y z) :precision binary64 (if (<= y -7.8e-39) y (if (<= y 1.3e-54) (/ x z) y)))
double code(double x, double y, double z) {
double tmp;
if (y <= -7.8e-39) {
tmp = y;
} else if (y <= 1.3e-54) {
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 <= (-7.8d-39)) then
tmp = y
else if (y <= 1.3d-54) 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 <= -7.8e-39) {
tmp = y;
} else if (y <= 1.3e-54) {
tmp = x / z;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7.8e-39: tmp = y elif y <= 1.3e-54: tmp = x / z else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7.8e-39) tmp = y; elseif (y <= 1.3e-54) tmp = Float64(x / z); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -7.8e-39) tmp = y; elseif (y <= 1.3e-54) tmp = x / z; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7.8e-39], y, If[LessEqual[y, 1.3e-54], N[(x / z), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{-39}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-54}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -7.80000000000000059e-39 or 1.30000000000000001e-54 < y Initial program 75.0%
Taylor expanded in x around 0 48.0%
if -7.80000000000000059e-39 < y < 1.30000000000000001e-54Initial program 99.9%
Taylor expanded in y around 0 83.2%
(FPCore (x y z) :precision binary64 (if (<= y 9e+46) (+ y (/ x z)) (* y (/ x (- z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 9e+46) {
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 <= 9d+46) 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 <= 9e+46) {
tmp = y + (x / z);
} else {
tmp = y * (x / -z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 9e+46: tmp = y + (x / z) else: tmp = y * (x / -z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 9e+46) tmp = Float64(y + Float64(x / z)); else tmp = Float64(y * Float64(x / Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 9e+46) tmp = y + (x / z); else tmp = y * (x / -z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 9e+46], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / (-z)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9 \cdot 10^{+46}:\\
\;\;\;\;y + \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{-z}\\
\end{array}
\end{array}
if y < 9.00000000000000019e46Initial program 87.8%
Taylor expanded in x around inf 90.6%
associate-+r+90.6%
+-commutative90.6%
mul-1-neg90.6%
unsub-neg90.6%
div-sub90.6%
Simplified90.6%
Taylor expanded in z around inf 95.0%
Taylor expanded in y around 0 83.9%
if 9.00000000000000019e46 < y Initial program 75.8%
Taylor expanded in x around inf 56.9%
associate-/l*58.3%
mul-1-neg58.3%
unsub-neg58.3%
Simplified58.3%
Taylor expanded in y around inf 56.9%
mul-1-neg56.9%
associate-*l/61.3%
distribute-lft-neg-out61.3%
distribute-neg-frac261.3%
*-commutative61.3%
Simplified61.3%
(FPCore (x y z) :precision binary64 (if (<= y 6.7e+48) (+ y (/ x z)) (* x (/ y (- z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 6.7e+48) {
tmp = y + (x / z);
} else {
tmp = x * (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 <= 6.7d+48) then
tmp = y + (x / z)
else
tmp = x * (y / -z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 6.7e+48) {
tmp = y + (x / z);
} else {
tmp = x * (y / -z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 6.7e+48: tmp = y + (x / z) else: tmp = x * (y / -z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 6.7e+48) tmp = Float64(y + Float64(x / z)); else tmp = Float64(x * Float64(y / Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 6.7e+48) tmp = y + (x / z); else tmp = x * (y / -z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 6.7e+48], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / (-z)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.7 \cdot 10^{+48}:\\
\;\;\;\;y + \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{-z}\\
\end{array}
\end{array}
if y < 6.7e48Initial program 87.8%
Taylor expanded in x around inf 90.6%
associate-+r+90.6%
+-commutative90.6%
mul-1-neg90.6%
unsub-neg90.6%
div-sub90.6%
Simplified90.6%
Taylor expanded in z around inf 95.0%
Taylor expanded in y around 0 83.9%
if 6.7e48 < y Initial program 75.8%
Taylor expanded in x around inf 56.9%
associate-/l*58.3%
mul-1-neg58.3%
unsub-neg58.3%
Simplified58.3%
Taylor expanded in y around inf 58.3%
neg-mul-158.3%
distribute-neg-frac58.3%
Simplified58.3%
Final simplification77.7%
(FPCore (x y z) :precision binary64 (if (<= y 1.0) (+ y (/ x z)) (/ (* y x) x)))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.0) {
tmp = y + (x / z);
} else {
tmp = (y * x) / 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 <= 1.0d0) then
tmp = y + (x / z)
else
tmp = (y * x) / x
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) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.0: tmp = y + (x / z) else: tmp = (y * x) / x return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.0) tmp = Float64(y + Float64(x / z)); else tmp = Float64(Float64(y * x) / x); 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) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.0], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;y + \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{x}\\
\end{array}
\end{array}
if y < 1Initial program 87.1%
Taylor expanded in x around inf 91.6%
associate-+r+91.6%
+-commutative91.6%
mul-1-neg91.6%
unsub-neg91.6%
div-sub91.6%
Simplified91.6%
Taylor expanded in z around inf 94.7%
Taylor expanded in y around 0 85.7%
if 1 < y Initial program 79.4%
Taylor expanded in x around inf 72.6%
associate-+r+72.6%
+-commutative72.6%
mul-1-neg72.6%
unsub-neg72.6%
div-sub72.6%
Simplified72.6%
Taylor expanded in z around inf 21.3%
*-commutative21.3%
associate-*l/47.6%
Applied egg-rr47.6%
(FPCore (x y z) :precision binary64 (+ y (/ x z)))
double code(double x, double y, double z) {
return y + (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 = y + (x / z)
end function
public static double code(double x, double y, double z) {
return y + (x / z);
}
def code(x, y, z): return y + (x / z)
function code(x, y, z) return Float64(y + Float64(x / z)) end
function tmp = code(x, y, z) tmp = y + (x / z); end
code[x_, y_, z_] := N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y + \frac{x}{z}
\end{array}
Initial program 84.9%
Taylor expanded in x around inf 86.2%
associate-+r+86.2%
+-commutative86.2%
mul-1-neg86.2%
unsub-neg86.2%
div-sub86.2%
Simplified86.2%
Taylor expanded in z around inf 94.7%
Taylor expanded in y around 0 73.1%
(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 84.9%
Taylor expanded in x around 0 36.4%
(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 2024144
(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))