
(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 -4.8e+38) (not (<= y 195.0))) (- y (/ y (/ z x))) (/ (+ x (* y (- z x))) z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4.8e+38) || !(y <= 195.0)) {
tmp = y - (y / (z / x));
} 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 <= (-4.8d+38)) .or. (.not. (y <= 195.0d0))) then
tmp = y - (y / (z / x))
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 <= -4.8e+38) || !(y <= 195.0)) {
tmp = y - (y / (z / x));
} else {
tmp = (x + (y * (z - x))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4.8e+38) or not (y <= 195.0): tmp = y - (y / (z / x)) else: tmp = (x + (y * (z - x))) / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4.8e+38) || !(y <= 195.0)) tmp = Float64(y - Float64(y / Float64(z / x))); 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 <= -4.8e+38) || ~((y <= 195.0))) tmp = y - (y / (z / x)); else tmp = (x + (y * (z - x))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4.8e+38], N[Not[LessEqual[y, 195.0]], $MachinePrecision]], N[(y - N[(y / N[(z / x), $MachinePrecision]), $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 -4.8 \cdot 10^{+38} \lor \neg \left(y \leq 195\right):\\
\;\;\;\;y - \frac{y}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \left(z - x\right)}{z}\\
\end{array}
\end{array}
if y < -4.80000000000000035e38 or 195 < y Initial program 77.2%
Taylor expanded in y around inf 77.2%
associate-/l*99.9%
div-sub99.9%
sub-neg99.9%
*-inverses99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 89.5%
associate-*r/89.5%
mul-1-neg89.5%
distribute-rgt-neg-out89.5%
Simplified89.5%
*-commutative89.5%
associate-*l/87.7%
add-sqr-sqrt41.2%
sqrt-unprod46.7%
sqr-neg46.7%
sqrt-unprod26.3%
add-sqr-sqrt43.4%
cancel-sign-sub43.4%
distribute-frac-neg43.4%
*-commutative43.4%
associate-*r/48.1%
div-inv48.1%
*-commutative48.1%
associate-*l*50.5%
add-sqr-sqrt19.3%
sqrt-unprod46.8%
sqr-neg46.8%
sqrt-unprod54.8%
add-sqr-sqrt99.9%
div-inv99.9%
clear-num99.9%
Applied egg-rr99.9%
if -4.80000000000000035e38 < y < 195Initial program 99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -550000000000.0) (not (<= y 1.0))) (- y (/ y (/ z x))) (+ y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -550000000000.0) || !(y <= 1.0)) {
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 <= (-550000000000.0d0)) .or. (.not. (y <= 1.0d0))) 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 <= -550000000000.0) || !(y <= 1.0)) {
tmp = y - (y / (z / x));
} else {
tmp = y + (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -550000000000.0) or not (y <= 1.0): tmp = y - (y / (z / x)) else: tmp = y + (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -550000000000.0) || !(y <= 1.0)) 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 <= -550000000000.0) || ~((y <= 1.0))) tmp = y - (y / (z / x)); else tmp = y + (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -550000000000.0], N[Not[LessEqual[y, 1.0]], $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 -550000000000 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;y - \frac{y}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;y + \frac{x}{z}\\
\end{array}
\end{array}
if y < -5.5e11 or 1 < y Initial program 78.0%
Taylor expanded in y around inf 78.0%
associate-/l*99.9%
div-sub99.9%
sub-neg99.9%
*-inverses99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 89.8%
associate-*r/89.8%
mul-1-neg89.8%
distribute-rgt-neg-out89.8%
Simplified89.8%
*-commutative89.8%
associate-*l/88.0%
add-sqr-sqrt43.0%
sqrt-unprod48.3%
sqr-neg48.3%
sqrt-unprod25.5%
add-sqr-sqrt42.7%
cancel-sign-sub42.7%
distribute-frac-neg42.7%
*-commutative42.7%
associate-*r/47.2%
div-inv47.2%
*-commutative47.2%
associate-*l*49.6%
add-sqr-sqrt19.3%
sqrt-unprod46.0%
sqr-neg46.0%
sqrt-unprod53.0%
add-sqr-sqrt99.9%
div-inv99.9%
clear-num99.9%
Applied egg-rr99.9%
if -5.5e11 < y < 1Initial program 99.9%
Taylor expanded in y around 0 98.4%
Taylor expanded in x around 0 97.6%
Final simplification98.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -550000000000.0) (not (<= y 1.0))) (* y (- 1.0 (/ x z))) (+ y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -550000000000.0) || !(y <= 1.0)) {
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 <= (-550000000000.0d0)) .or. (.not. (y <= 1.0d0))) 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 <= -550000000000.0) || !(y <= 1.0)) {
tmp = y * (1.0 - (x / z));
} else {
tmp = y + (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -550000000000.0) or not (y <= 1.0): tmp = y * (1.0 - (x / z)) else: tmp = y + (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -550000000000.0) || !(y <= 1.0)) 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 <= -550000000000.0) || ~((y <= 1.0))) tmp = y * (1.0 - (x / z)); else tmp = y + (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -550000000000.0], N[Not[LessEqual[y, 1.0]], $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 -550000000000 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;y \cdot \left(1 - \frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;y + \frac{x}{z}\\
\end{array}
\end{array}
if y < -5.5e11 or 1 < y Initial program 78.0%
Taylor expanded in y around inf 78.0%
associate-/l*99.9%
div-sub99.9%
sub-neg99.9%
*-inverses99.9%
sub-neg99.9%
Simplified99.9%
if -5.5e11 < y < 1Initial program 99.9%
Taylor expanded in y around 0 98.4%
Taylor expanded in x around 0 97.6%
Final simplification98.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -8.5e+156) (not (<= x 4.9e+26))) (* x (/ (- 1.0 y) z)) (+ y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -8.5e+156) || !(x <= 4.9e+26)) {
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 <= (-8.5d+156)) .or. (.not. (x <= 4.9d+26))) 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 <= -8.5e+156) || !(x <= 4.9e+26)) {
tmp = x * ((1.0 - y) / z);
} else {
tmp = y + (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -8.5e+156) or not (x <= 4.9e+26): tmp = x * ((1.0 - y) / z) else: tmp = y + (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -8.5e+156) || !(x <= 4.9e+26)) 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 <= -8.5e+156) || ~((x <= 4.9e+26))) tmp = x * ((1.0 - y) / z); else tmp = y + (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -8.5e+156], N[Not[LessEqual[x, 4.9e+26]], $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 -8.5 \cdot 10^{+156} \lor \neg \left(x \leq 4.9 \cdot 10^{+26}\right):\\
\;\;\;\;x \cdot \frac{1 - y}{z}\\
\mathbf{else}:\\
\;\;\;\;y + \frac{x}{z}\\
\end{array}
\end{array}
if x < -8.49999999999999948e156 or 4.89999999999999974e26 < x Initial program 83.8%
Taylor expanded in x around inf 78.8%
associate-/l*92.0%
mul-1-neg92.0%
unsub-neg92.0%
Simplified92.0%
if -8.49999999999999948e156 < x < 4.89999999999999974e26Initial program 90.8%
Taylor expanded in y around 0 99.4%
Taylor expanded in x around 0 83.0%
Final simplification85.4%
(FPCore (x y z) :precision binary64 (if (<= y -0.065) y (if (<= y 6.4e-71) (/ x z) y)))
double code(double x, double y, double z) {
double tmp;
if (y <= -0.065) {
tmp = y;
} else if (y <= 6.4e-71) {
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.065d0)) then
tmp = y
else if (y <= 6.4d-71) 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.065) {
tmp = y;
} else if (y <= 6.4e-71) {
tmp = x / z;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -0.065: tmp = y elif y <= 6.4e-71: tmp = x / z else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -0.065) tmp = y; elseif (y <= 6.4e-71) tmp = Float64(x / z); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -0.065) tmp = y; elseif (y <= 6.4e-71) tmp = x / z; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -0.065], y, If[LessEqual[y, 6.4e-71], N[(x / z), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.065:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{-71}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -0.065000000000000002 or 6.3999999999999998e-71 < y Initial program 80.7%
Taylor expanded in x around 0 52.8%
if -0.065000000000000002 < y < 6.3999999999999998e-71Initial program 99.9%
Taylor expanded in y around 0 71.8%
(FPCore (x y z) :precision binary64 (if (<= y -1.8e+115) (* y (/ x (- z))) (+ y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.8e+115) {
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.8d+115)) 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.8e+115) {
tmp = y * (x / -z);
} else {
tmp = y + (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.8e+115: tmp = y * (x / -z) else: tmp = y + (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.8e+115) tmp = Float64(y * Float64(x / Float64(-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.8e+115) tmp = y * (x / -z); else tmp = y + (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.8e+115], 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.8 \cdot 10^{+115}:\\
\;\;\;\;y \cdot \frac{x}{-z}\\
\mathbf{else}:\\
\;\;\;\;y + \frac{x}{z}\\
\end{array}
\end{array}
if y < -1.8e115Initial program 68.3%
Taylor expanded in y around inf 68.3%
associate-/l*100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in x around inf 62.6%
mul-1-neg62.6%
distribute-frac-neg262.6%
Simplified62.6%
if -1.8e115 < y Initial program 92.9%
Taylor expanded in y around 0 98.1%
Taylor expanded in x around 0 81.6%
(FPCore (x y z) :precision binary64 (if (<= x -3.5e+213) (* x (/ y (- z))) (+ y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.5e+213) {
tmp = x * (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 <= (-3.5d+213)) then
tmp = x * (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 <= -3.5e+213) {
tmp = x * (y / -z);
} else {
tmp = y + (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.5e+213: tmp = x * (y / -z) else: tmp = y + (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.5e+213) tmp = Float64(x * Float64(y / Float64(-z))); else tmp = Float64(y + Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.5e+213) tmp = x * (y / -z); else tmp = y + (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.5e+213], N[(x * N[(y / (-z)), $MachinePrecision]), $MachinePrecision], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{+213}:\\
\;\;\;\;x \cdot \frac{y}{-z}\\
\mathbf{else}:\\
\;\;\;\;y + \frac{x}{z}\\
\end{array}
\end{array}
if x < -3.4999999999999997e213Initial program 63.8%
Taylor expanded in x around inf 63.8%
associate-/l*95.4%
mul-1-neg95.4%
unsub-neg95.4%
Simplified95.4%
Taylor expanded in y around inf 68.3%
neg-mul-168.3%
distribute-neg-frac68.3%
Simplified68.3%
if -3.4999999999999997e213 < x Initial program 90.8%
Taylor expanded in y around 0 99.5%
Taylor expanded in x around 0 79.0%
Final simplification78.3%
(FPCore (x y z) :precision binary64 (+ (/ x z) (* y (- 1.0 (/ x z)))))
double code(double x, double y, double z) {
return (x / z) + (y * (1.0 - (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 / z) + (y * (1.0d0 - (x / z)))
end function
public static double code(double x, double y, double z) {
return (x / z) + (y * (1.0 - (x / z)));
}
def code(x, y, z): return (x / z) + (y * (1.0 - (x / z)))
function code(x, y, z) return Float64(Float64(x / z) + Float64(y * Float64(1.0 - Float64(x / z)))) end
function tmp = code(x, y, z) tmp = (x / z) + (y * (1.0 - (x / z))); end
code[x_, y_, z_] := N[(N[(x / z), $MachinePrecision] + N[(y * N[(1.0 - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{z} + y \cdot \left(1 - \frac{x}{z}\right)
\end{array}
Initial program 88.9%
Taylor expanded in y around 0 98.4%
Final simplification98.4%
(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.9%
Taylor expanded in y around 0 98.4%
Taylor expanded in x around 0 76.0%
(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.9%
Taylor expanded in x around 0 42.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 2024165
(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))