
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y * (z - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
def code(x, y, z, t): return x + ((y * (z - x)) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(y * Float64(z - x)) / t)) end
function tmp = code(x, y, z, t) tmp = x + ((y * (z - x)) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - x\right)}{t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y * (z - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
def code(x, y, z, t): return x + ((y * (z - x)) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(y * Float64(z - x)) / t)) end
function tmp = code(x, y, z, t) tmp = x + ((y * (z - x)) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - x\right)}{t}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= t 1.15e-139) (+ x (* (/ y t) (- z x))) (+ x (/ y (/ t (- z x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.15e-139) {
tmp = x + ((y / t) * (z - x));
} else {
tmp = x + (y / (t / (z - x)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 1.15d-139) then
tmp = x + ((y / t) * (z - x))
else
tmp = x + (y / (t / (z - x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.15e-139) {
tmp = x + ((y / t) * (z - x));
} else {
tmp = x + (y / (t / (z - x)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 1.15e-139: tmp = x + ((y / t) * (z - x)) else: tmp = x + (y / (t / (z - x))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 1.15e-139) tmp = Float64(x + Float64(Float64(y / t) * Float64(z - x))); else tmp = Float64(x + Float64(y / Float64(t / Float64(z - x)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 1.15e-139) tmp = x + ((y / t) * (z - x)); else tmp = x + (y / (t / (z - x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.15e-139], N[(x + N[(N[(y / t), $MachinePrecision] * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.15 \cdot 10^{-139}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - x}}\\
\end{array}
\end{array}
if t < 1.15000000000000006e-139Initial program 95.0%
associate-*l/98.8%
Simplified98.8%
if 1.15000000000000006e-139 < t Initial program 88.8%
associate-/l*98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1e-79) (not (<= z 3.6e-93))) (+ x (/ z (/ t y))) (+ x (/ y (/ (- t) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1e-79) || !(z <= 3.6e-93)) {
tmp = x + (z / (t / y));
} else {
tmp = x + (y / (-t / x));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1d-79)) .or. (.not. (z <= 3.6d-93))) then
tmp = x + (z / (t / y))
else
tmp = x + (y / (-t / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1e-79) || !(z <= 3.6e-93)) {
tmp = x + (z / (t / y));
} else {
tmp = x + (y / (-t / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1e-79) or not (z <= 3.6e-93): tmp = x + (z / (t / y)) else: tmp = x + (y / (-t / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1e-79) || !(z <= 3.6e-93)) tmp = Float64(x + Float64(z / Float64(t / y))); else tmp = Float64(x + Float64(y / Float64(Float64(-t) / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1e-79) || ~((z <= 3.6e-93))) tmp = x + (z / (t / y)); else tmp = x + (y / (-t / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1e-79], N[Not[LessEqual[z, 3.6e-93]], $MachinePrecision]], N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[((-t) / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-79} \lor \neg \left(z \leq 3.6 \cdot 10^{-93}\right):\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{-t}{x}}\\
\end{array}
\end{array}
if z < -1e-79 or 3.6000000000000002e-93 < z Initial program 92.4%
associate-*l/98.8%
Simplified98.8%
*-commutative98.8%
clear-num98.8%
un-div-inv98.9%
Applied egg-rr98.9%
Taylor expanded in z around inf 83.1%
*-commutative83.1%
associate-/l*87.3%
Simplified87.3%
if -1e-79 < z < 3.6000000000000002e-93Initial program 92.7%
associate-/l*98.1%
Simplified98.1%
Taylor expanded in z around 0 86.0%
associate-*r/86.0%
neg-mul-186.0%
Simplified86.0%
Final simplification86.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.45e+179) (not (<= x 1.26e+128))) (* x (- 1.0 (/ y t))) (+ x (* (/ y t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.45e+179) || !(x <= 1.26e+128)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + ((y / t) * z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-3.45d+179)) .or. (.not. (x <= 1.26d+128))) then
tmp = x * (1.0d0 - (y / t))
else
tmp = x + ((y / t) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.45e+179) || !(x <= 1.26e+128)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + ((y / t) * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.45e+179) or not (x <= 1.26e+128): tmp = x * (1.0 - (y / t)) else: tmp = x + ((y / t) * z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.45e+179) || !(x <= 1.26e+128)) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(x + Float64(Float64(y / t) * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.45e+179) || ~((x <= 1.26e+128))) tmp = x * (1.0 - (y / t)); else tmp = x + ((y / t) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.45e+179], N[Not[LessEqual[x, 1.26e+128]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.45 \cdot 10^{+179} \lor \neg \left(x \leq 1.26 \cdot 10^{+128}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t} \cdot z\\
\end{array}
\end{array}
if x < -3.4500000000000001e179 or 1.26000000000000009e128 < x Initial program 86.1%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around inf 94.2%
mul-1-neg94.2%
unsub-neg94.2%
Simplified94.2%
if -3.4500000000000001e179 < x < 1.26000000000000009e128Initial program 94.9%
associate-*l/95.9%
Simplified95.9%
Taylor expanded in z around inf 79.5%
associate-*l/84.1%
*-commutative84.1%
Simplified84.1%
Final simplification86.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.8e+179) (not (<= x 2.1e+128))) (* x (- 1.0 (/ y t))) (+ x (/ z (/ t y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.8e+179) || !(x <= 2.1e+128)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + (z / (t / y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-4.8d+179)) .or. (.not. (x <= 2.1d+128))) then
tmp = x * (1.0d0 - (y / t))
else
tmp = x + (z / (t / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.8e+179) || !(x <= 2.1e+128)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + (z / (t / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.8e+179) or not (x <= 2.1e+128): tmp = x * (1.0 - (y / t)) else: tmp = x + (z / (t / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4.8e+179) || !(x <= 2.1e+128)) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(x + Float64(z / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -4.8e+179) || ~((x <= 2.1e+128))) tmp = x * (1.0 - (y / t)); else tmp = x + (z / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.8e+179], N[Not[LessEqual[x, 2.1e+128]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+179} \lor \neg \left(x \leq 2.1 \cdot 10^{+128}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\
\end{array}
\end{array}
if x < -4.80000000000000025e179 or 2.1e128 < x Initial program 86.1%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around inf 94.2%
mul-1-neg94.2%
unsub-neg94.2%
Simplified94.2%
if -4.80000000000000025e179 < x < 2.1e128Initial program 94.9%
associate-*l/95.9%
Simplified95.9%
*-commutative95.9%
clear-num95.9%
un-div-inv95.9%
Applied egg-rr95.9%
Taylor expanded in z around inf 79.5%
*-commutative79.5%
associate-/l*84.1%
Simplified84.1%
Final simplification86.8%
(FPCore (x y z t) :precision binary64 (if (<= t -5.6e-8) x (if (<= t 2.3e-33) (* x (/ (- y) t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.6e-8) {
tmp = x;
} else if (t <= 2.3e-33) {
tmp = x * (-y / t);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5.6d-8)) then
tmp = x
else if (t <= 2.3d-33) then
tmp = x * (-y / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.6e-8) {
tmp = x;
} else if (t <= 2.3e-33) {
tmp = x * (-y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5.6e-8: tmp = x elif t <= 2.3e-33: tmp = x * (-y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5.6e-8) tmp = x; elseif (t <= 2.3e-33) tmp = Float64(x * Float64(Float64(-y) / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -5.6e-8) tmp = x; elseif (t <= 2.3e-33) tmp = x * (-y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.6e-8], x, If[LessEqual[t, 2.3e-33], N[(x * N[((-y) / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.6 \cdot 10^{-8}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-33}:\\
\;\;\;\;x \cdot \frac{-y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -5.5999999999999999e-8 or 2.29999999999999986e-33 < t Initial program 87.3%
associate-*l/98.7%
Simplified98.7%
Taylor expanded in y around 0 62.4%
if -5.5999999999999999e-8 < t < 2.29999999999999986e-33Initial program 98.3%
associate-*l/95.2%
Simplified95.2%
Taylor expanded in x around inf 55.2%
mul-1-neg55.2%
unsub-neg55.2%
Simplified55.2%
Taylor expanded in y around inf 47.4%
associate-*r/47.4%
neg-mul-147.4%
Simplified47.4%
Final simplification55.3%
(FPCore (x y z t) :precision binary64 (if (<= z -1.15e+272) (* x (/ y t)) (* x (- 1.0 (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.15e+272) {
tmp = x * (y / t);
} else {
tmp = x * (1.0 - (y / t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.15d+272)) then
tmp = x * (y / t)
else
tmp = x * (1.0d0 - (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.15e+272) {
tmp = x * (y / t);
} else {
tmp = x * (1.0 - (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.15e+272: tmp = x * (y / t) else: tmp = x * (1.0 - (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.15e+272) tmp = Float64(x * Float64(y / t)); else tmp = Float64(x * Float64(1.0 - Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.15e+272) tmp = x * (y / t); else tmp = x * (1.0 - (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.15e+272], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+272}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\end{array}
\end{array}
if z < -1.15e272Initial program 100.0%
associate-*l/94.6%
Simplified94.6%
Taylor expanded in x around inf 16.9%
mul-1-neg16.9%
unsub-neg16.9%
Simplified16.9%
Taylor expanded in y around inf 8.3%
associate-*r/8.3%
neg-mul-18.3%
Simplified8.3%
expm1-log1p-u8.1%
expm1-udef8.1%
add-sqr-sqrt7.9%
sqrt-unprod14.9%
distribute-frac-neg14.9%
distribute-frac-neg14.9%
sqr-neg14.9%
sqrt-unprod0.5%
add-sqr-sqrt22.0%
Applied egg-rr22.0%
expm1-def22.1%
expm1-log1p57.8%
Simplified57.8%
if -1.15e272 < z Initial program 92.1%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in x around inf 67.1%
mul-1-neg67.1%
unsub-neg67.1%
Simplified67.1%
Final simplification66.6%
(FPCore (x y z t) :precision binary64 (+ x (* (/ y t) (- z x))))
double code(double x, double y, double z, double t) {
return x + ((y / t) * (z - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y / t) * (z - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y / t) * (z - x));
}
def code(x, y, z, t): return x + ((y / t) * (z - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y / t) * Float64(z - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y / t) * (z - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y / t), $MachinePrecision] * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{t} \cdot \left(z - x\right)
\end{array}
Initial program 92.5%
associate-*l/97.0%
Simplified97.0%
Final simplification97.0%
(FPCore (x y z t) :precision binary64 (if (<= y -5e+224) (* x (/ y t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5e+224) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-5d+224)) then
tmp = x * (y / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5e+224) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5e+224: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5e+224) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5e+224) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5e+224], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+224}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.99999999999999964e224Initial program 84.2%
associate-*l/89.7%
Simplified89.7%
Taylor expanded in x around inf 30.2%
mul-1-neg30.2%
unsub-neg30.2%
Simplified30.2%
Taylor expanded in y around inf 26.2%
associate-*r/26.2%
neg-mul-126.2%
Simplified26.2%
expm1-log1p-u13.3%
expm1-udef12.8%
add-sqr-sqrt12.4%
sqrt-unprod23.5%
distribute-frac-neg23.5%
distribute-frac-neg23.5%
sqr-neg23.5%
sqrt-unprod5.7%
add-sqr-sqrt6.2%
Applied egg-rr6.2%
expm1-def6.1%
expm1-log1p28.3%
Simplified28.3%
if -4.99999999999999964e224 < y Initial program 93.1%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in y around 0 40.6%
Final simplification39.7%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 92.5%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in y around 0 38.0%
Final simplification38.0%
(FPCore (x y z t) :precision binary64 (- x (+ (* x (/ y t)) (* (- z) (/ y t)))))
double code(double x, double y, double z, double t) {
return x - ((x * (y / t)) + (-z * (y / t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x - ((x * (y / t)) + (-z * (y / t)))
end function
public static double code(double x, double y, double z, double t) {
return x - ((x * (y / t)) + (-z * (y / t)));
}
def code(x, y, z, t): return x - ((x * (y / t)) + (-z * (y / t)))
function code(x, y, z, t) return Float64(x - Float64(Float64(x * Float64(y / t)) + Float64(Float64(-z) * Float64(y / t)))) end
function tmp = code(x, y, z, t) tmp = x - ((x * (y / t)) + (-z * (y / t))); end
code[x_, y_, z_, t_] := N[(x - N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] + N[((-z) * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)
\end{array}
herbie shell --seed 2024010
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:herbie-target
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))