
(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) (/ 1.0 (- 1.0 y)))))
double code(double x, double y, double z) {
return y + ((x / z) / (1.0 / (1.0 - 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 + ((x / z) / (1.0d0 / (1.0d0 - y)))
end function
public static double code(double x, double y, double z) {
return y + ((x / z) / (1.0 / (1.0 - y)));
}
def code(x, y, z): return y + ((x / z) / (1.0 / (1.0 - y)))
function code(x, y, z) return Float64(y + Float64(Float64(x / z) / Float64(1.0 / Float64(1.0 - y)))) end
function tmp = code(x, y, z) tmp = y + ((x / z) / (1.0 / (1.0 - y))); end
code[x_, y_, z_] := N[(y + N[(N[(x / z), $MachinePrecision] / N[(1.0 / N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y + \frac{\frac{x}{z}}{\frac{1}{1 - y}}
\end{array}
Initial program 86.4%
Taylor expanded in x around 0 96.1%
+-commutative96.1%
mul-1-neg96.1%
unsub-neg96.1%
div-sub96.1%
clear-num96.1%
associate-/r/96.4%
clear-num96.5%
div-inv96.5%
associate-/r*99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(if (or (<= y -2.5e+209)
(and (not (<= y -1.65e+154))
(or (<= y -1.19e+82) (not (<= y 60000000000000.0)))))
(- (/ y (/ z x)))
(+ (/ x z) y)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.5e+209) || (!(y <= -1.65e+154) && ((y <= -1.19e+82) || !(y <= 60000000000000.0)))) {
tmp = -(y / (z / x));
} else {
tmp = (x / 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 <= (-2.5d+209)) .or. (.not. (y <= (-1.65d+154))) .and. (y <= (-1.19d+82)) .or. (.not. (y <= 60000000000000.0d0))) then
tmp = -(y / (z / x))
else
tmp = (x / z) + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -2.5e+209) || (!(y <= -1.65e+154) && ((y <= -1.19e+82) || !(y <= 60000000000000.0)))) {
tmp = -(y / (z / x));
} else {
tmp = (x / z) + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.5e+209) or (not (y <= -1.65e+154) and ((y <= -1.19e+82) or not (y <= 60000000000000.0))): tmp = -(y / (z / x)) else: tmp = (x / z) + y return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.5e+209) || (!(y <= -1.65e+154) && ((y <= -1.19e+82) || !(y <= 60000000000000.0)))) tmp = Float64(-Float64(y / Float64(z / x))); else tmp = Float64(Float64(x / z) + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2.5e+209) || (~((y <= -1.65e+154)) && ((y <= -1.19e+82) || ~((y <= 60000000000000.0))))) tmp = -(y / (z / x)); else tmp = (x / z) + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.5e+209], And[N[Not[LessEqual[y, -1.65e+154]], $MachinePrecision], Or[LessEqual[y, -1.19e+82], N[Not[LessEqual[y, 60000000000000.0]], $MachinePrecision]]]], (-N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), N[(N[(x / z), $MachinePrecision] + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+209} \lor \neg \left(y \leq -1.65 \cdot 10^{+154}\right) \land \left(y \leq -1.19 \cdot 10^{+82} \lor \neg \left(y \leq 60000000000000\right)\right):\\
\;\;\;\;-\frac{y}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} + y\\
\end{array}
\end{array}
if y < -2.49999999999999982e209 or -1.65e154 < y < -1.1899999999999999e82 or 6e13 < y Initial program 74.6%
Taylor expanded in x around inf 61.8%
*-commutative61.8%
associate-/l*66.2%
mul-1-neg66.2%
unsub-neg66.2%
Simplified66.2%
Taylor expanded in y around inf 66.2%
associate-*r/66.2%
neg-mul-166.2%
Simplified66.2%
frac-2neg66.2%
distribute-frac-neg66.2%
remove-double-neg66.2%
frac-2neg66.2%
distribute-frac-neg66.2%
frac-2neg66.2%
associate-/r/71.1%
clear-num71.0%
associate-*l/71.1%
*-un-lft-identity71.1%
Applied egg-rr71.1%
if -2.49999999999999982e209 < y < -1.65e154 or -1.1899999999999999e82 < y < 6e13Initial program 93.9%
Taylor expanded in x around 0 98.5%
Taylor expanded in y around 0 94.2%
Final simplification85.3%
(FPCore (x y z)
:precision binary64
(if (<= y -4.2e+209)
(* (/ y z) (- x))
(if (or (<= y -4.5e+153) (and (not (<= y -1.19e+82)) (<= y 55000000000.0)))
(+ (/ x z) y)
(- (/ y (/ z x))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -4.2e+209) {
tmp = (y / z) * -x;
} else if ((y <= -4.5e+153) || (!(y <= -1.19e+82) && (y <= 55000000000.0))) {
tmp = (x / z) + y;
} else {
tmp = -(y / (z / 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 <= (-4.2d+209)) then
tmp = (y / z) * -x
else if ((y <= (-4.5d+153)) .or. (.not. (y <= (-1.19d+82))) .and. (y <= 55000000000.0d0)) then
tmp = (x / z) + y
else
tmp = -(y / (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -4.2e+209) {
tmp = (y / z) * -x;
} else if ((y <= -4.5e+153) || (!(y <= -1.19e+82) && (y <= 55000000000.0))) {
tmp = (x / z) + y;
} else {
tmp = -(y / (z / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -4.2e+209: tmp = (y / z) * -x elif (y <= -4.5e+153) or (not (y <= -1.19e+82) and (y <= 55000000000.0)): tmp = (x / z) + y else: tmp = -(y / (z / x)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -4.2e+209) tmp = Float64(Float64(y / z) * Float64(-x)); elseif ((y <= -4.5e+153) || (!(y <= -1.19e+82) && (y <= 55000000000.0))) tmp = Float64(Float64(x / z) + y); else tmp = Float64(-Float64(y / Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -4.2e+209) tmp = (y / z) * -x; elseif ((y <= -4.5e+153) || (~((y <= -1.19e+82)) && (y <= 55000000000.0))) tmp = (x / z) + y; else tmp = -(y / (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -4.2e+209], N[(N[(y / z), $MachinePrecision] * (-x)), $MachinePrecision], If[Or[LessEqual[y, -4.5e+153], And[N[Not[LessEqual[y, -1.19e+82]], $MachinePrecision], LessEqual[y, 55000000000.0]]], N[(N[(x / z), $MachinePrecision] + y), $MachinePrecision], (-N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision])]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+209}:\\
\;\;\;\;\frac{y}{z} \cdot \left(-x\right)\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{+153} \lor \neg \left(y \leq -1.19 \cdot 10^{+82}\right) \land y \leq 55000000000:\\
\;\;\;\;\frac{x}{z} + y\\
\mathbf{else}:\\
\;\;\;\;-\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if y < -4.2e209Initial program 62.4%
Taylor expanded in x around inf 52.1%
*-commutative52.1%
associate-/l*68.8%
mul-1-neg68.8%
unsub-neg68.8%
Simplified68.8%
Taylor expanded in y around inf 68.8%
associate-*r/68.8%
neg-mul-168.8%
Simplified68.8%
frac-2neg68.8%
div-inv68.6%
distribute-frac-neg68.6%
remove-double-neg68.6%
frac-2neg68.6%
clear-num68.8%
frac-2neg68.8%
Applied egg-rr68.8%
if -4.2e209 < y < -4.5000000000000001e153 or -1.1899999999999999e82 < y < 5.5e10Initial program 93.9%
Taylor expanded in x around 0 98.5%
Taylor expanded in y around 0 94.2%
if -4.5000000000000001e153 < y < -1.1899999999999999e82 or 5.5e10 < y Initial program 78.0%
Taylor expanded in x around inf 64.5%
*-commutative64.5%
associate-/l*65.5%
mul-1-neg65.5%
unsub-neg65.5%
Simplified65.5%
Taylor expanded in y around inf 65.5%
associate-*r/65.5%
neg-mul-165.5%
Simplified65.5%
frac-2neg65.5%
distribute-frac-neg65.5%
remove-double-neg65.5%
frac-2neg65.5%
distribute-frac-neg65.5%
frac-2neg65.5%
associate-/r/71.8%
clear-num71.7%
associate-*l/71.8%
*-un-lft-identity71.8%
Applied egg-rr71.8%
Final simplification85.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -2e+27) (not (<= y 90000000.0))) (/ y (/ z (- z x))) (/ (+ x (* y (- z x))) z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2e+27) || !(y <= 90000000.0)) {
tmp = y / (z / (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 <= (-2d+27)) .or. (.not. (y <= 90000000.0d0))) then
tmp = y / (z / (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 <= -2e+27) || !(y <= 90000000.0)) {
tmp = y / (z / (z - x));
} else {
tmp = (x + (y * (z - x))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2e+27) or not (y <= 90000000.0): tmp = y / (z / (z - x)) else: tmp = (x + (y * (z - x))) / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2e+27) || !(y <= 90000000.0)) tmp = Float64(y / Float64(z / 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 <= -2e+27) || ~((y <= 90000000.0))) tmp = y / (z / (z - x)); else tmp = (x + (y * (z - x))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2e+27], N[Not[LessEqual[y, 90000000.0]], $MachinePrecision]], N[(y / N[(z / 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 -2 \cdot 10^{+27} \lor \neg \left(y \leq 90000000\right):\\
\;\;\;\;\frac{y}{\frac{z}{z - x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \left(z - x\right)}{z}\\
\end{array}
\end{array}
if y < -2e27 or 9e7 < y Initial program 73.4%
Taylor expanded in y around inf 73.4%
associate-/l*99.9%
Simplified99.9%
if -2e27 < y < 9e7Initial program 99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -4e+17) (not (<= y 1.0))) (* (- z x) (/ y z)) (+ (/ x z) y)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4e+17) || !(y <= 1.0)) {
tmp = (z - x) * (y / z);
} else {
tmp = (x / 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 <= (-4d+17)) .or. (.not. (y <= 1.0d0))) then
tmp = (z - x) * (y / z)
else
tmp = (x / z) + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -4e+17) || !(y <= 1.0)) {
tmp = (z - x) * (y / z);
} else {
tmp = (x / z) + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4e+17) or not (y <= 1.0): tmp = (z - x) * (y / z) else: tmp = (x / z) + y return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4e+17) || !(y <= 1.0)) tmp = Float64(Float64(z - x) * Float64(y / z)); else tmp = Float64(Float64(x / z) + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -4e+17) || ~((y <= 1.0))) tmp = (z - x) * (y / z); else tmp = (x / z) + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4e+17], N[Not[LessEqual[y, 1.0]], $MachinePrecision]], N[(N[(z - x), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+17} \lor \neg \left(y \leq 1\right):\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} + y\\
\end{array}
\end{array}
if y < -4e17 or 1 < y Initial program 73.6%
Taylor expanded in y around inf 73.6%
associate-/l*99.9%
associate-/r/92.7%
Applied egg-rr92.7%
if -4e17 < y < 1Initial program 99.9%
Taylor expanded in x around 0 99.7%
Taylor expanded in y around 0 99.1%
Final simplification95.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -4e+17) (not (<= y 1.0))) (/ y (/ z (- z x))) (+ (/ x z) y)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4e+17) || !(y <= 1.0)) {
tmp = y / (z / (z - x));
} else {
tmp = (x / 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 <= (-4d+17)) .or. (.not. (y <= 1.0d0))) then
tmp = y / (z / (z - x))
else
tmp = (x / z) + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -4e+17) || !(y <= 1.0)) {
tmp = y / (z / (z - x));
} else {
tmp = (x / z) + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4e+17) or not (y <= 1.0): tmp = y / (z / (z - x)) else: tmp = (x / z) + y return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4e+17) || !(y <= 1.0)) tmp = Float64(y / Float64(z / Float64(z - x))); else tmp = Float64(Float64(x / z) + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -4e+17) || ~((y <= 1.0))) tmp = y / (z / (z - x)); else tmp = (x / z) + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4e+17], N[Not[LessEqual[y, 1.0]], $MachinePrecision]], N[(y / N[(z / N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+17} \lor \neg \left(y \leq 1\right):\\
\;\;\;\;\frac{y}{\frac{z}{z - x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} + y\\
\end{array}
\end{array}
if y < -4e17 or 1 < y Initial program 73.6%
Taylor expanded in y around inf 73.6%
associate-/l*99.9%
Simplified99.9%
if -4e17 < y < 1Initial program 99.9%
Taylor expanded in x around 0 99.7%
Taylor expanded in y around 0 99.1%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (if (<= y -7.2e-57) y (if (<= y 2.6e-24) (/ x z) y)))
double code(double x, double y, double z) {
double tmp;
if (y <= -7.2e-57) {
tmp = y;
} else if (y <= 2.6e-24) {
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.2d-57)) then
tmp = y
else if (y <= 2.6d-24) 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.2e-57) {
tmp = y;
} else if (y <= 2.6e-24) {
tmp = x / z;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7.2e-57: tmp = y elif y <= 2.6e-24: tmp = x / z else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7.2e-57) tmp = y; elseif (y <= 2.6e-24) tmp = Float64(x / z); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -7.2e-57) tmp = y; elseif (y <= 2.6e-24) tmp = x / z; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7.2e-57], y, If[LessEqual[y, 2.6e-24], N[(x / z), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{-57}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-24}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -7.2000000000000005e-57 or 2.6e-24 < y Initial program 77.6%
Taylor expanded in x around 0 43.5%
if -7.2000000000000005e-57 < y < 2.6e-24Initial program 99.9%
Taylor expanded in y around 0 79.4%
Final simplification57.7%
(FPCore (x y z) :precision binary64 (+ (/ x z) y))
double code(double x, double y, double z) {
return (x / z) + y;
}
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
end function
public static double code(double x, double y, double z) {
return (x / z) + y;
}
def code(x, y, z): return (x / z) + y
function code(x, y, z) return Float64(Float64(x / z) + y) end
function tmp = code(x, y, z) tmp = (x / z) + y; end
code[x_, y_, z_] := N[(N[(x / z), $MachinePrecision] + y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{z} + y
\end{array}
Initial program 86.4%
Taylor expanded in x around 0 96.1%
Taylor expanded in y around 0 71.2%
Final simplification71.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 86.4%
Taylor expanded in x around 0 35.2%
Final simplification35.2%
(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 2023199
(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))