
(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) (+ y -1.0))))
double code(double x, double y, double z) {
return y - ((x / z) * (y + -1.0));
}
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 + (-1.0d0)))
end function
public static double code(double x, double y, double z) {
return y - ((x / z) * (y + -1.0));
}
def code(x, y, z): return y - ((x / z) * (y + -1.0))
function code(x, y, z) return Float64(y - Float64(Float64(x / z) * Float64(y + -1.0))) end
function tmp = code(x, y, z) tmp = y - ((x / z) * (y + -1.0)); end
code[x_, y_, z_] := N[(y - N[(N[(x / z), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y - \frac{x}{z} \cdot \left(y + -1\right)
\end{array}
Initial program 85.2%
Taylor expanded in x around -inf 94.8%
mul-1-neg94.8%
unsub-neg94.8%
associate-/l*97.5%
associate-/r/99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (- x) (/ z y))))
(if (<= y -8.5e+69)
t_0
(if (<= y 1.2e+15)
(+ y (/ x z))
(if (<= y 1.9e+140) t_0 (/ z (/ z y)))))))
double code(double x, double y, double z) {
double t_0 = -x / (z / y);
double tmp;
if (y <= -8.5e+69) {
tmp = t_0;
} else if (y <= 1.2e+15) {
tmp = y + (x / z);
} else if (y <= 1.9e+140) {
tmp = t_0;
} else {
tmp = z / (z / 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 = -x / (z / y)
if (y <= (-8.5d+69)) then
tmp = t_0
else if (y <= 1.2d+15) then
tmp = y + (x / z)
else if (y <= 1.9d+140) then
tmp = t_0
else
tmp = z / (z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -x / (z / y);
double tmp;
if (y <= -8.5e+69) {
tmp = t_0;
} else if (y <= 1.2e+15) {
tmp = y + (x / z);
} else if (y <= 1.9e+140) {
tmp = t_0;
} else {
tmp = z / (z / y);
}
return tmp;
}
def code(x, y, z): t_0 = -x / (z / y) tmp = 0 if y <= -8.5e+69: tmp = t_0 elif y <= 1.2e+15: tmp = y + (x / z) elif y <= 1.9e+140: tmp = t_0 else: tmp = z / (z / y) return tmp
function code(x, y, z) t_0 = Float64(Float64(-x) / Float64(z / y)) tmp = 0.0 if (y <= -8.5e+69) tmp = t_0; elseif (y <= 1.2e+15) tmp = Float64(y + Float64(x / z)); elseif (y <= 1.9e+140) tmp = t_0; else tmp = Float64(z / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -x / (z / y); tmp = 0.0; if (y <= -8.5e+69) tmp = t_0; elseif (y <= 1.2e+15) tmp = y + (x / z); elseif (y <= 1.9e+140) tmp = t_0; else tmp = z / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[((-x) / N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.5e+69], t$95$0, If[LessEqual[y, 1.2e+15], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+140], t$95$0, N[(z / N[(z / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\frac{z}{y}}\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{+69}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+15}:\\
\;\;\;\;y + \frac{x}{z}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+140}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -8.5000000000000002e69 or 1.2e15 < y < 1.9e140Initial program 76.5%
Taylor expanded in y around inf 76.5%
associate-/l*100.0%
associate-/r/94.3%
Simplified94.3%
Taylor expanded in z around 0 59.7%
mul-1-neg59.7%
associate-/l*60.8%
Simplified60.8%
if -8.5000000000000002e69 < y < 1.2e15Initial program 99.9%
Taylor expanded in z around inf 96.5%
Taylor expanded in x around 0 96.6%
if 1.9e140 < y Initial program 51.9%
Taylor expanded in z around inf 11.1%
Taylor expanded in x around 0 11.9%
associate-/l*53.0%
associate-/r/65.3%
Applied egg-rr65.3%
*-commutative65.3%
clear-num65.1%
un-div-inv66.4%
Applied egg-rr66.4%
Final simplification80.7%
(FPCore (x y z)
:precision binary64
(if (<= y -3.2e+69)
(/ (- x) (/ z y))
(if (<= y 8e+14)
(+ y (/ x z))
(if (<= y 3.6e+141) (* y (/ (- x) z)) (/ z (/ z y))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.2e+69) {
tmp = -x / (z / y);
} else if (y <= 8e+14) {
tmp = y + (x / z);
} else if (y <= 3.6e+141) {
tmp = y * (-x / z);
} else {
tmp = z / (z / 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 <= (-3.2d+69)) then
tmp = -x / (z / y)
else if (y <= 8d+14) then
tmp = y + (x / z)
else if (y <= 3.6d+141) then
tmp = y * (-x / z)
else
tmp = z / (z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3.2e+69) {
tmp = -x / (z / y);
} else if (y <= 8e+14) {
tmp = y + (x / z);
} else if (y <= 3.6e+141) {
tmp = y * (-x / z);
} else {
tmp = z / (z / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3.2e+69: tmp = -x / (z / y) elif y <= 8e+14: tmp = y + (x / z) elif y <= 3.6e+141: tmp = y * (-x / z) else: tmp = z / (z / y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3.2e+69) tmp = Float64(Float64(-x) / Float64(z / y)); elseif (y <= 8e+14) tmp = Float64(y + Float64(x / z)); elseif (y <= 3.6e+141) tmp = Float64(y * Float64(Float64(-x) / z)); else tmp = Float64(z / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3.2e+69) tmp = -x / (z / y); elseif (y <= 8e+14) tmp = y + (x / z); elseif (y <= 3.6e+141) tmp = y * (-x / z); else tmp = z / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3.2e+69], N[((-x) / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e+14], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.6e+141], N[(y * N[((-x) / z), $MachinePrecision]), $MachinePrecision], N[(z / N[(z / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{+69}:\\
\;\;\;\;\frac{-x}{\frac{z}{y}}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+14}:\\
\;\;\;\;y + \frac{x}{z}\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+141}:\\
\;\;\;\;y \cdot \frac{-x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -3.19999999999999985e69Initial program 73.6%
Taylor expanded in y around inf 73.6%
associate-/l*100.0%
associate-/r/96.3%
Simplified96.3%
Taylor expanded in z around 0 57.0%
mul-1-neg57.0%
associate-/l*64.0%
Simplified64.0%
if -3.19999999999999985e69 < y < 8e14Initial program 99.9%
Taylor expanded in z around inf 96.5%
Taylor expanded in x around 0 96.6%
if 8e14 < y < 3.6000000000000001e141Initial program 81.2%
Taylor expanded in y around inf 81.2%
associate-/l*99.9%
associate-/r/91.2%
Simplified91.2%
Taylor expanded in z around 0 64.2%
mul-1-neg64.2%
*-commutative64.2%
associate-*r/64.2%
distribute-rgt-neg-out64.2%
distribute-frac-neg64.2%
Simplified64.2%
if 3.6000000000000001e141 < y Initial program 51.9%
Taylor expanded in z around inf 11.1%
Taylor expanded in x around 0 11.9%
associate-/l*53.0%
associate-/r/65.3%
Applied egg-rr65.3%
*-commutative65.3%
clear-num65.1%
un-div-inv66.4%
Applied egg-rr66.4%
Final simplification81.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -14.2) (not (<= y 1.0))) (* (- z x) (/ y z)) (+ y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -14.2) || !(y <= 1.0)) {
tmp = (z - 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 ((y <= (-14.2d0)) .or. (.not. (y <= 1.0d0))) then
tmp = (z - 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 ((y <= -14.2) || !(y <= 1.0)) {
tmp = (z - x) * (y / z);
} else {
tmp = y + (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -14.2) or not (y <= 1.0): tmp = (z - x) * (y / z) else: tmp = y + (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -14.2) || !(y <= 1.0)) tmp = Float64(Float64(z - x) * Float64(y / z)); else tmp = Float64(y + Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -14.2) || ~((y <= 1.0))) tmp = (z - x) * (y / z); else tmp = y + (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -14.2], N[Not[LessEqual[y, 1.0]], $MachinePrecision]], N[(N[(z - x), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -14.2 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;y + \frac{x}{z}\\
\end{array}
\end{array}
if y < -14.199999999999999 or 1 < y Initial program 70.9%
Taylor expanded in y around inf 70.4%
associate-/l*99.5%
associate-/r/93.9%
Simplified93.9%
if -14.199999999999999 < y < 1Initial program 99.9%
Taylor expanded in z around inf 98.4%
Taylor expanded in x around 0 98.5%
Final simplification96.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -14.2) (not (<= y 1.0))) (/ y (/ z (- z x))) (+ y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -14.2) || !(y <= 1.0)) {
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 <= (-14.2d0)) .or. (.not. (y <= 1.0d0))) 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 <= -14.2) || !(y <= 1.0)) {
tmp = y / (z / (z - x));
} else {
tmp = y + (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -14.2) or not (y <= 1.0): tmp = y / (z / (z - x)) else: tmp = y + (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -14.2) || !(y <= 1.0)) tmp = Float64(y / Float64(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 <= -14.2) || ~((y <= 1.0))) tmp = y / (z / (z - x)); else tmp = y + (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -14.2], N[Not[LessEqual[y, 1.0]], $MachinePrecision]], N[(y / N[(z / N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -14.2 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;\frac{y}{\frac{z}{z - x}}\\
\mathbf{else}:\\
\;\;\;\;y + \frac{x}{z}\\
\end{array}
\end{array}
if y < -14.199999999999999 or 1 < y Initial program 70.9%
Taylor expanded in y around inf 70.4%
associate-/l*99.5%
Simplified99.5%
if -14.199999999999999 < y < 1Initial program 99.9%
Taylor expanded in z around inf 98.4%
Taylor expanded in x around 0 98.5%
Final simplification99.0%
(FPCore (x y z) :precision binary64 (if (<= z -1.4e+77) y (if (<= z 1.6) (/ x z) y)))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.4e+77) {
tmp = y;
} else if (z <= 1.6) {
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 <= (-1.4d+77)) then
tmp = y
else if (z <= 1.6d0) 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 <= -1.4e+77) {
tmp = y;
} else if (z <= 1.6) {
tmp = x / z;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.4e+77: tmp = y elif z <= 1.6: tmp = x / z else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.4e+77) tmp = y; elseif (z <= 1.6) tmp = Float64(x / z); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.4e+77) tmp = y; elseif (z <= 1.6) tmp = x / z; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.4e+77], y, If[LessEqual[z, 1.6], N[(x / z), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+77}:\\
\;\;\;\;y\\
\mathbf{elif}\;z \leq 1.6:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if z < -1.4e77 or 1.6000000000000001 < z Initial program 65.2%
Taylor expanded in x around 0 72.0%
if -1.4e77 < z < 1.6000000000000001Initial program 99.3%
Taylor expanded in y around 0 53.1%
Final simplification61.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.8%
Taylor expanded in z around inf 79.0%
Taylor expanded in x around 0 84.1%
if 1 < y Initial program 65.4%
Taylor expanded in z around inf 15.1%
Taylor expanded in x around 0 16.1%
associate-/l*46.9%
associate-/r/55.1%
Applied egg-rr55.1%
Final simplification76.1%
(FPCore (x y z) :precision binary64 (if (<= y 1.0) (+ y (/ x z)) (/ z (/ z y))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.0) {
tmp = y + (x / z);
} else {
tmp = z / (z / 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 <= 1.0d0) then
tmp = y + (x / z)
else
tmp = z / (z / y)
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 / (z / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.0: tmp = y + (x / z) else: tmp = z / (z / y) 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(z / y)); 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 / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.0], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], N[(z / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;y + \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < 1Initial program 92.8%
Taylor expanded in z around inf 79.0%
Taylor expanded in x around 0 84.1%
if 1 < y Initial program 65.4%
Taylor expanded in z around inf 15.1%
Taylor expanded in x around 0 16.1%
associate-/l*46.9%
associate-/r/55.1%
Applied egg-rr55.1%
*-commutative55.1%
clear-num54.9%
un-div-inv55.6%
Applied egg-rr55.6%
Final simplification76.2%
(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 85.2%
Taylor expanded in x around 0 38.1%
Final simplification38.1%
(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 2023293
(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))