
(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 8 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 (<= y -130.0) (* y (- 1.0 (/ x z))) (if (<= y 1.0) (+ y (/ x z)) (* y (/ (- z x) z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -130.0) {
tmp = y * (1.0 - (x / z));
} else if (y <= 1.0) {
tmp = y + (x / z);
} else {
tmp = 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 <= (-130.0d0)) then
tmp = y * (1.0d0 - (x / z))
else if (y <= 1.0d0) then
tmp = y + (x / z)
else
tmp = y * ((z - x) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -130.0) {
tmp = y * (1.0 - (x / z));
} else if (y <= 1.0) {
tmp = y + (x / z);
} else {
tmp = y * ((z - x) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -130.0: tmp = y * (1.0 - (x / z)) elif y <= 1.0: tmp = y + (x / z) else: tmp = y * ((z - x) / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -130.0) tmp = Float64(y * Float64(1.0 - Float64(x / z))); elseif (y <= 1.0) tmp = Float64(y + Float64(x / z)); else tmp = Float64(y * Float64(Float64(z - x) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -130.0) tmp = y * (1.0 - (x / z)); elseif (y <= 1.0) tmp = y + (x / z); else tmp = y * ((z - x) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -130.0], N[(y * N[(1.0 - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -130:\\
\;\;\;\;y \cdot \left(1 - \frac{x}{z}\right)\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;y + \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - x}{z}\\
\end{array}
\end{array}
if y < -130Initial program 80.0%
Taylor expanded in x around inf 94.4%
Taylor expanded in y around 0 94.4%
+-commutative94.4%
mul-1-neg94.4%
unsub-neg94.4%
*-commutative94.4%
Simplified94.4%
Taylor expanded in y around inf 99.2%
if -130 < y < 1Initial program 99.9%
Taylor expanded in z around inf 98.5%
Taylor expanded in x around 0 98.5%
+-commutative98.5%
Simplified98.5%
if 1 < y Initial program 70.6%
Taylor expanded in y around inf 70.0%
associate-/l*98.8%
Simplified98.8%
clear-num98.7%
associate-/r/98.8%
clear-num98.8%
Applied egg-rr98.8%
Final simplification98.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ (- x) z))))
(if (<= y -2.2e+120)
t_0
(if (<= y 1.45e+32)
(+ y (/ x z))
(if (or (<= y 7.6e+104) (not (<= y 1.12e+286))) t_0 y)))))
double code(double x, double y, double z) {
double t_0 = y * (-x / z);
double tmp;
if (y <= -2.2e+120) {
tmp = t_0;
} else if (y <= 1.45e+32) {
tmp = y + (x / z);
} else if ((y <= 7.6e+104) || !(y <= 1.12e+286)) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = y * (-x / z)
if (y <= (-2.2d+120)) then
tmp = t_0
else if (y <= 1.45d+32) then
tmp = y + (x / z)
else if ((y <= 7.6d+104) .or. (.not. (y <= 1.12d+286))) then
tmp = t_0
else
tmp = y
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 <= -2.2e+120) {
tmp = t_0;
} else if (y <= 1.45e+32) {
tmp = y + (x / z);
} else if ((y <= 7.6e+104) || !(y <= 1.12e+286)) {
tmp = t_0;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): t_0 = y * (-x / z) tmp = 0 if y <= -2.2e+120: tmp = t_0 elif y <= 1.45e+32: tmp = y + (x / z) elif (y <= 7.6e+104) or not (y <= 1.12e+286): tmp = t_0 else: tmp = y return tmp
function code(x, y, z) t_0 = Float64(y * Float64(Float64(-x) / z)) tmp = 0.0 if (y <= -2.2e+120) tmp = t_0; elseif (y <= 1.45e+32) tmp = Float64(y + Float64(x / z)); elseif ((y <= 7.6e+104) || !(y <= 1.12e+286)) tmp = t_0; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (-x / z); tmp = 0.0; if (y <= -2.2e+120) tmp = t_0; elseif (y <= 1.45e+32) tmp = y + (x / z); elseif ((y <= 7.6e+104) || ~((y <= 1.12e+286))) tmp = t_0; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[((-x) / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e+120], t$95$0, If[LessEqual[y, 1.45e+32], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 7.6e+104], N[Not[LessEqual[y, 1.12e+286]], $MachinePrecision]], t$95$0, y]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{-x}{z}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+120}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+32}:\\
\;\;\;\;y + \frac{x}{z}\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{+104} \lor \neg \left(y \leq 1.12 \cdot 10^{+286}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -2.2000000000000001e120 or 1.45000000000000001e32 < y < 7.59999999999999938e104 or 1.12000000000000006e286 < y Initial program 86.9%
Taylor expanded in x around inf 95.0%
Taylor expanded in y around 0 95.0%
+-commutative95.0%
mul-1-neg95.0%
unsub-neg95.0%
*-commutative95.0%
Simplified95.0%
Taylor expanded in y around inf 99.9%
Taylor expanded in x around inf 65.9%
associate-*r/65.9%
mul-1-neg65.9%
distribute-rgt-neg-in65.9%
associate-*r/70.0%
Simplified70.0%
if -2.2000000000000001e120 < y < 1.45000000000000001e32Initial program 94.7%
Taylor expanded in z around inf 90.1%
Taylor expanded in x around 0 94.2%
+-commutative94.2%
Simplified94.2%
if 7.59999999999999938e104 < y < 1.12000000000000006e286Initial program 58.4%
Taylor expanded in x around 0 66.7%
Final simplification85.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ (- x) z))))
(if (<= y -2.5e+119)
t_0
(if (<= y 1.15e+54)
(+ y (/ x z))
(if (<= y 1.02e+104) (/ y (/ (- z) x)) (if (<= y 4.1e+290) y t_0))))))
double code(double x, double y, double z) {
double t_0 = y * (-x / z);
double tmp;
if (y <= -2.5e+119) {
tmp = t_0;
} else if (y <= 1.15e+54) {
tmp = y + (x / z);
} else if (y <= 1.02e+104) {
tmp = y / (-z / x);
} else if (y <= 4.1e+290) {
tmp = y;
} else {
tmp = t_0;
}
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 <= (-2.5d+119)) then
tmp = t_0
else if (y <= 1.15d+54) then
tmp = y + (x / z)
else if (y <= 1.02d+104) then
tmp = y / (-z / x)
else if (y <= 4.1d+290) then
tmp = y
else
tmp = t_0
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 <= -2.5e+119) {
tmp = t_0;
} else if (y <= 1.15e+54) {
tmp = y + (x / z);
} else if (y <= 1.02e+104) {
tmp = y / (-z / x);
} else if (y <= 4.1e+290) {
tmp = y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (-x / z) tmp = 0 if y <= -2.5e+119: tmp = t_0 elif y <= 1.15e+54: tmp = y + (x / z) elif y <= 1.02e+104: tmp = y / (-z / x) elif y <= 4.1e+290: tmp = y else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(Float64(-x) / z)) tmp = 0.0 if (y <= -2.5e+119) tmp = t_0; elseif (y <= 1.15e+54) tmp = Float64(y + Float64(x / z)); elseif (y <= 1.02e+104) tmp = Float64(y / Float64(Float64(-z) / x)); elseif (y <= 4.1e+290) tmp = y; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (-x / z); tmp = 0.0; if (y <= -2.5e+119) tmp = t_0; elseif (y <= 1.15e+54) tmp = y + (x / z); elseif (y <= 1.02e+104) tmp = y / (-z / x); elseif (y <= 4.1e+290) tmp = y; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[((-x) / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.5e+119], t$95$0, If[LessEqual[y, 1.15e+54], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e+104], N[(y / N[((-z) / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e+290], y, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{-x}{z}\\
\mathbf{if}\;y \leq -2.5 \cdot 10^{+119}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+54}:\\
\;\;\;\;y + \frac{x}{z}\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{+104}:\\
\;\;\;\;\frac{y}{\frac{-z}{x}}\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{+290}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -2.5e119 or 4.09999999999999999e290 < y Initial program 87.9%
Taylor expanded in x around inf 96.0%
Taylor expanded in y around 0 96.0%
+-commutative96.0%
mul-1-neg96.0%
unsub-neg96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in y around inf 99.9%
Taylor expanded in x around inf 64.2%
associate-*r/64.2%
mul-1-neg64.2%
distribute-rgt-neg-in64.2%
associate-*r/67.2%
Simplified67.2%
if -2.5e119 < y < 1.14999999999999997e54Initial program 94.8%
Taylor expanded in z around inf 89.6%
Taylor expanded in x around 0 93.7%
+-commutative93.7%
Simplified93.7%
if 1.14999999999999997e54 < y < 1.02e104Initial program 78.6%
Taylor expanded in y around inf 78.6%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around 0 89.0%
associate-*r/89.0%
neg-mul-189.0%
Simplified89.0%
if 1.02e104 < y < 4.09999999999999999e290Initial program 58.4%
Taylor expanded in x around 0 66.7%
Final simplification85.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -130.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 <= -130.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 <= (-130.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 <= -130.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 <= -130.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 <= -130.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 <= -130.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, -130.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 -130 \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 < -130 or 1 < y Initial program 75.6%
Taylor expanded in x around inf 90.9%
Taylor expanded in y around 0 90.9%
+-commutative90.9%
mul-1-neg90.9%
unsub-neg90.9%
*-commutative90.9%
Simplified90.9%
Taylor expanded in y around inf 99.0%
if -130 < y < 1Initial program 99.9%
Taylor expanded in z around inf 98.5%
Taylor expanded in x around 0 98.5%
+-commutative98.5%
Simplified98.5%
Final simplification98.7%
(FPCore (x y z) :precision binary64 (if (<= y 72000000000.0) (+ y (/ (- x (* y x)) z)) (* y (- 1.0 (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 72000000000.0) {
tmp = y + ((x - (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 <= 72000000000.0d0) then
tmp = y + ((x - (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 <= 72000000000.0) {
tmp = y + ((x - (y * x)) / z);
} else {
tmp = y * (1.0 - (x / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 72000000000.0: tmp = y + ((x - (y * x)) / z) else: tmp = y * (1.0 - (x / z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 72000000000.0) tmp = Float64(y + Float64(Float64(x - Float64(y * 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 <= 72000000000.0) tmp = y + ((x - (y * x)) / z); else tmp = y * (1.0 - (x / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 72000000000.0], N[(y + N[(N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(1.0 - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 72000000000:\\
\;\;\;\;y + \frac{x - y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - \frac{x}{z}\right)\\
\end{array}
\end{array}
if y < 7.2e10Initial program 93.3%
Taylor expanded in x around inf 98.1%
Taylor expanded in y around 0 98.1%
+-commutative98.1%
mul-1-neg98.1%
unsub-neg98.1%
*-commutative98.1%
Simplified98.1%
if 7.2e10 < y Initial program 70.1%
Taylor expanded in x around inf 86.8%
Taylor expanded in y around 0 86.8%
+-commutative86.8%
mul-1-neg86.8%
unsub-neg86.8%
*-commutative86.8%
Simplified86.8%
Taylor expanded in y around inf 99.4%
Final simplification98.4%
(FPCore (x y z) :precision binary64 (if (<= y -7.5e-15) y (if (<= y 3.25e-40) (/ x z) y)))
double code(double x, double y, double z) {
double tmp;
if (y <= -7.5e-15) {
tmp = y;
} else if (y <= 3.25e-40) {
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.5d-15)) then
tmp = y
else if (y <= 3.25d-40) 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.5e-15) {
tmp = y;
} else if (y <= 3.25e-40) {
tmp = x / z;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7.5e-15: tmp = y elif y <= 3.25e-40: tmp = x / z else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7.5e-15) tmp = y; elseif (y <= 3.25e-40) tmp = Float64(x / z); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -7.5e-15) tmp = y; elseif (y <= 3.25e-40) tmp = x / z; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7.5e-15], y, If[LessEqual[y, 3.25e-40], N[(x / z), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{-15}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 3.25 \cdot 10^{-40}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -7.4999999999999996e-15 or 3.25e-40 < y Initial program 79.0%
Taylor expanded in x around 0 53.9%
if -7.4999999999999996e-15 < y < 3.25e-40Initial program 99.9%
Taylor expanded in y around 0 74.9%
Final simplification63.1%
(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.1%
Taylor expanded in z around inf 70.0%
Taylor expanded in x around 0 78.2%
+-commutative78.2%
Simplified78.2%
Final simplification78.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 88.1%
Taylor expanded in x around 0 42.1%
Final simplification42.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 2023230
(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))