
(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 (<= z -4.2e-96) (not (<= z 5e-21))) (+ (/ x z) (* y (- 1.0 (/ x z)))) (/ (+ x (* y (- z x))) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4.2e-96) || !(z <= 5e-21)) {
tmp = (x / z) + (y * (1.0 - (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 ((z <= (-4.2d-96)) .or. (.not. (z <= 5d-21))) then
tmp = (x / z) + (y * (1.0d0 - (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 ((z <= -4.2e-96) || !(z <= 5e-21)) {
tmp = (x / z) + (y * (1.0 - (x / z)));
} else {
tmp = (x + (y * (z - x))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4.2e-96) or not (z <= 5e-21): tmp = (x / z) + (y * (1.0 - (x / z))) else: tmp = (x + (y * (z - x))) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4.2e-96) || !(z <= 5e-21)) tmp = Float64(Float64(x / z) + Float64(y * Float64(1.0 - Float64(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 ((z <= -4.2e-96) || ~((z <= 5e-21))) tmp = (x / z) + (y * (1.0 - (x / z))); else tmp = (x + (y * (z - x))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4.2e-96], N[Not[LessEqual[z, 5e-21]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] + N[(y * N[(1.0 - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-96} \lor \neg \left(z \leq 5 \cdot 10^{-21}\right):\\
\;\;\;\;\frac{x}{z} + y \cdot \left(1 - \frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \left(z - x\right)}{z}\\
\end{array}
\end{array}
if z < -4.20000000000000002e-96 or 4.99999999999999973e-21 < z Initial program 79.8%
Taylor expanded in y around 0 100.0%
if -4.20000000000000002e-96 < z < 4.99999999999999973e-21Initial program 99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= y -2.1e+28) (* y (+ 1.0 (* x (/ -1.0 z)))) (if (<= y 540000000000.0) (/ (+ x (* y (- z x))) z) (* y (- 1.0 (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.1e+28) {
tmp = y * (1.0 + (x * (-1.0 / z)));
} else if (y <= 540000000000.0) {
tmp = (x + (y * (z - x))) / z;
} else {
tmp = y * (1.0 - (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 <= (-2.1d+28)) then
tmp = y * (1.0d0 + (x * ((-1.0d0) / z)))
else if (y <= 540000000000.0d0) then
tmp = (x + (y * (z - x))) / z
else
tmp = y * (1.0d0 - (x / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.1e+28) {
tmp = y * (1.0 + (x * (-1.0 / z)));
} else if (y <= 540000000000.0) {
tmp = (x + (y * (z - x))) / z;
} else {
tmp = y * (1.0 - (x / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.1e+28: tmp = y * (1.0 + (x * (-1.0 / z))) elif y <= 540000000000.0: tmp = (x + (y * (z - x))) / z else: tmp = y * (1.0 - (x / z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.1e+28) tmp = Float64(y * Float64(1.0 + Float64(x * Float64(-1.0 / z)))); elseif (y <= 540000000000.0) tmp = Float64(Float64(x + Float64(y * Float64(z - x))) / z); else tmp = Float64(y * Float64(1.0 - Float64(x / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.1e+28) tmp = y * (1.0 + (x * (-1.0 / z))); elseif (y <= 540000000000.0) tmp = (x + (y * (z - x))) / z; else tmp = y * (1.0 - (x / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.1e+28], N[(y * N[(1.0 + N[(x * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 540000000000.0], N[(N[(x + N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y * N[(1.0 - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+28}:\\
\;\;\;\;y \cdot \left(1 + x \cdot \frac{-1}{z}\right)\\
\mathbf{elif}\;y \leq 540000000000:\\
\;\;\;\;\frac{x + y \cdot \left(z - x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - \frac{x}{z}\right)\\
\end{array}
\end{array}
if y < -2.09999999999999989e28Initial program 73.5%
Taylor expanded in y around inf 73.5%
associate-/l*99.9%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
clear-num99.8%
associate-/r/100.0%
Applied egg-rr100.0%
if -2.09999999999999989e28 < y < 5.4e11Initial program 99.9%
if 5.4e11 < y Initial program 79.7%
Taylor expanded in y around inf 79.7%
associate-/l*99.9%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -5.5e+20) (not (<= y 0.0255))) (* y (- 1.0 (/ x z))) (+ y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -5.5e+20) || !(y <= 0.0255)) {
tmp = y * (1.0 - (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 <= (-5.5d+20)) .or. (.not. (y <= 0.0255d0))) then
tmp = y * (1.0d0 - (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 <= -5.5e+20) || !(y <= 0.0255)) {
tmp = y * (1.0 - (x / z));
} else {
tmp = y + (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -5.5e+20) or not (y <= 0.0255): tmp = y * (1.0 - (x / z)) else: tmp = y + (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -5.5e+20) || !(y <= 0.0255)) tmp = Float64(y * Float64(1.0 - 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 <= -5.5e+20) || ~((y <= 0.0255))) tmp = y * (1.0 - (x / z)); else tmp = y + (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -5.5e+20], N[Not[LessEqual[y, 0.0255]], $MachinePrecision]], N[(y * N[(1.0 - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+20} \lor \neg \left(y \leq 0.0255\right):\\
\;\;\;\;y \cdot \left(1 - \frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;y + \frac{x}{z}\\
\end{array}
\end{array}
if y < -5.5e20 or 0.0254999999999999984 < y Initial program 77.4%
Taylor expanded in y around inf 76.7%
associate-/l*99.2%
div-sub99.2%
*-inverses99.2%
Simplified99.2%
if -5.5e20 < y < 0.0254999999999999984Initial program 99.9%
Taylor expanded in y around 0 95.0%
Taylor expanded in x around 0 98.9%
Taylor expanded in y around 0 98.9%
Final simplification99.1%
(FPCore (x y z) :precision binary64 (if (or (<= x -5.7e+82) (not (<= x 2.25e+126))) (* x (/ (- 1.0 y) z)) (+ y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -5.7e+82) || !(x <= 2.25e+126)) {
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 <= (-5.7d+82)) .or. (.not. (x <= 2.25d+126))) 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 <= -5.7e+82) || !(x <= 2.25e+126)) {
tmp = x * ((1.0 - y) / z);
} else {
tmp = y + (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -5.7e+82) or not (x <= 2.25e+126): tmp = x * ((1.0 - y) / z) else: tmp = y + (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -5.7e+82) || !(x <= 2.25e+126)) 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 <= -5.7e+82) || ~((x <= 2.25e+126))) tmp = x * ((1.0 - y) / z); else tmp = y + (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -5.7e+82], N[Not[LessEqual[x, 2.25e+126]], $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 -5.7 \cdot 10^{+82} \lor \neg \left(x \leq 2.25 \cdot 10^{+126}\right):\\
\;\;\;\;x \cdot \frac{1 - y}{z}\\
\mathbf{else}:\\
\;\;\;\;y + \frac{x}{z}\\
\end{array}
\end{array}
if x < -5.70000000000000016e82 or 2.24999999999999987e126 < x Initial program 87.3%
Taylor expanded in x around inf 84.9%
associate-/l*90.9%
mul-1-neg90.9%
unsub-neg90.9%
Simplified90.9%
if -5.70000000000000016e82 < x < 2.24999999999999987e126Initial program 88.4%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around 0 88.5%
Taylor expanded in y around 0 88.5%
Final simplification89.4%
(FPCore (x y z) :precision binary64 (if (<= y -5.5e+20) (* y (+ 1.0 (* x (/ -1.0 z)))) (if (<= y 0.0255) (+ y (/ x z)) (* y (- 1.0 (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -5.5e+20) {
tmp = y * (1.0 + (x * (-1.0 / z)));
} else if (y <= 0.0255) {
tmp = y + (x / z);
} else {
tmp = y * (1.0 - (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+20)) then
tmp = y * (1.0d0 + (x * ((-1.0d0) / z)))
else if (y <= 0.0255d0) then
tmp = y + (x / z)
else
tmp = y * (1.0d0 - (x / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -5.5e+20) {
tmp = y * (1.0 + (x * (-1.0 / z)));
} else if (y <= 0.0255) {
tmp = y + (x / z);
} else {
tmp = y * (1.0 - (x / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5.5e+20: tmp = y * (1.0 + (x * (-1.0 / z))) elif y <= 0.0255: tmp = y + (x / z) else: tmp = y * (1.0 - (x / z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5.5e+20) tmp = Float64(y * Float64(1.0 + Float64(x * Float64(-1.0 / z)))); elseif (y <= 0.0255) tmp = Float64(y + Float64(x / z)); else tmp = Float64(y * Float64(1.0 - Float64(x / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -5.5e+20) tmp = y * (1.0 + (x * (-1.0 / z))); elseif (y <= 0.0255) tmp = y + (x / z); else tmp = y * (1.0 - (x / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5.5e+20], N[(y * N[(1.0 + N[(x * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.0255], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(1.0 - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+20}:\\
\;\;\;\;y \cdot \left(1 + x \cdot \frac{-1}{z}\right)\\
\mathbf{elif}\;y \leq 0.0255:\\
\;\;\;\;y + \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - \frac{x}{z}\right)\\
\end{array}
\end{array}
if y < -5.5e20Initial program 74.5%
Taylor expanded in y around inf 74.5%
associate-/l*99.9%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
clear-num99.8%
associate-/r/99.9%
Applied egg-rr99.9%
if -5.5e20 < y < 0.0254999999999999984Initial program 99.9%
Taylor expanded in y around 0 95.0%
Taylor expanded in x around 0 98.9%
Taylor expanded in y around 0 98.9%
if 0.0254999999999999984 < y Initial program 81.0%
Taylor expanded in y around inf 79.5%
associate-/l*98.4%
div-sub98.4%
*-inverses98.4%
Simplified98.4%
Final simplification99.1%
(FPCore (x y z) :precision binary64 (if (<= y -5e-32) y (if (<= y 3.5e-90) (/ x z) y)))
double code(double x, double y, double z) {
double tmp;
if (y <= -5e-32) {
tmp = y;
} else if (y <= 3.5e-90) {
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 <= (-5d-32)) then
tmp = y
else if (y <= 3.5d-90) 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 <= -5e-32) {
tmp = y;
} else if (y <= 3.5e-90) {
tmp = x / z;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5e-32: tmp = y elif y <= 3.5e-90: tmp = x / z else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5e-32) tmp = y; elseif (y <= 3.5e-90) tmp = Float64(x / z); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -5e-32) tmp = y; elseif (y <= 3.5e-90) tmp = x / z; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5e-32], y, If[LessEqual[y, 3.5e-90], N[(x / z), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-32}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-90}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -5e-32 or 3.4999999999999999e-90 < y Initial program 80.5%
Taylor expanded in x around 0 51.9%
if -5e-32 < y < 3.4999999999999999e-90Initial program 99.9%
Taylor expanded in y around 0 76.3%
(FPCore (x y z) :precision binary64 (if (<= y 0.0255) (+ y (/ x z)) (- y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= 0.0255) {
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 <= 0.0255d0) 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 <= 0.0255) {
tmp = y + (x / z);
} else {
tmp = y - (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 0.0255: tmp = y + (x / z) else: tmp = y - (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 0.0255) 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 <= 0.0255) tmp = y + (x / z); else tmp = y - (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 0.0255], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.0255:\\
\;\;\;\;y + \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y - \frac{x}{z}\\
\end{array}
\end{array}
if y < 0.0254999999999999984Initial program 90.2%
Taylor expanded in y around 0 96.9%
Taylor expanded in x around 0 86.7%
Taylor expanded in y around 0 86.7%
if 0.0254999999999999984 < y Initial program 81.0%
Taylor expanded in y around 0 81.6%
Taylor expanded in x around 0 49.1%
*-rgt-identity49.1%
add-sqr-sqrt25.3%
sqrt-unprod51.3%
sqr-neg51.3%
sqrt-unprod31.3%
add-sqr-sqrt68.6%
distribute-frac-neg268.6%
sub-neg68.6%
Applied egg-rr68.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 88.0%
Taylor expanded in y around 0 93.3%
Taylor expanded in x around 0 77.9%
Taylor expanded in y around 0 77.9%
(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 88.0%
Taylor expanded in x around 0 41.7%
(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 2024137
(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))