
(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 (<= y -2.1e+87) (+ x (/ y (/ t (- z x)))) (+ x (* (- z x) (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e+87) {
tmp = x + (y / (t / (z - x)));
} else {
tmp = x + ((z - x) * (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 (y <= (-2.1d+87)) then
tmp = x + (y / (t / (z - x)))
else
tmp = x + ((z - x) * (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e+87) {
tmp = x + (y / (t / (z - x)));
} else {
tmp = x + ((z - x) * (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.1e+87: tmp = x + (y / (t / (z - x))) else: tmp = x + ((z - x) * (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.1e+87) tmp = Float64(x + Float64(y / Float64(t / Float64(z - x)))); else tmp = Float64(x + Float64(Float64(z - x) * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.1e+87) tmp = x + (y / (t / (z - x))); else tmp = x + ((z - x) * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.1e+87], N[(x + N[(y / N[(t / N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+87}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - x}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - x\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if y < -2.1e87Initial program 83.1%
Taylor expanded in z around 0 73.5%
+-commutative73.5%
*-commutative73.5%
associate-*r/68.9%
mul-1-neg68.9%
associate-/l*72.8%
distribute-lft-neg-in72.8%
distribute-rgt-in89.3%
sub-neg89.3%
Simplified89.3%
associate-*l/83.1%
associate-*r/99.8%
clear-num99.7%
un-div-inv99.9%
Applied egg-rr99.9%
if -2.1e87 < y Initial program 97.4%
Taylor expanded in z around 0 94.5%
+-commutative94.5%
*-commutative94.5%
associate-*r/94.2%
mul-1-neg94.2%
associate-/l*92.7%
distribute-lft-neg-in92.7%
distribute-rgt-in99.3%
sub-neg99.3%
Simplified99.3%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -5.1e-107)
(and (not (<= x 2.1e-151)) (or (<= x 8e-141) (not (<= x 6e-98)))))
(* x (- 1.0 (/ y t)))
(/ (* y z) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.1e-107) || (!(x <= 2.1e-151) && ((x <= 8e-141) || !(x <= 6e-98)))) {
tmp = x * (1.0 - (y / t));
} else {
tmp = (y * z) / 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 ((x <= (-5.1d-107)) .or. (.not. (x <= 2.1d-151)) .and. (x <= 8d-141) .or. (.not. (x <= 6d-98))) then
tmp = x * (1.0d0 - (y / t))
else
tmp = (y * z) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.1e-107) || (!(x <= 2.1e-151) && ((x <= 8e-141) || !(x <= 6e-98)))) {
tmp = x * (1.0 - (y / t));
} else {
tmp = (y * z) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5.1e-107) or (not (x <= 2.1e-151) and ((x <= 8e-141) or not (x <= 6e-98))): tmp = x * (1.0 - (y / t)) else: tmp = (y * z) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5.1e-107) || (!(x <= 2.1e-151) && ((x <= 8e-141) || !(x <= 6e-98)))) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(Float64(y * z) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -5.1e-107) || (~((x <= 2.1e-151)) && ((x <= 8e-141) || ~((x <= 6e-98))))) tmp = x * (1.0 - (y / t)); else tmp = (y * z) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5.1e-107], And[N[Not[LessEqual[x, 2.1e-151]], $MachinePrecision], Or[LessEqual[x, 8e-141], N[Not[LessEqual[x, 6e-98]], $MachinePrecision]]]], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.1 \cdot 10^{-107} \lor \neg \left(x \leq 2.1 \cdot 10^{-151}\right) \land \left(x \leq 8 \cdot 10^{-141} \lor \neg \left(x \leq 6 \cdot 10^{-98}\right)\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\end{array}
\end{array}
if x < -5.1000000000000002e-107 or 2.0999999999999999e-151 < x < 8.0000000000000003e-141 or 6e-98 < x Initial program 96.3%
Taylor expanded in x around inf 86.1%
mul-1-neg86.1%
unsub-neg86.1%
Simplified86.1%
if -5.1000000000000002e-107 < x < 2.0999999999999999e-151 or 8.0000000000000003e-141 < x < 6e-98Initial program 91.7%
Taylor expanded in t around 0 89.1%
Taylor expanded in x around 0 68.9%
Final simplification80.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.9e-94) (not (<= z 8.5e-113))) (+ x (* y (/ z t))) (* x (- 1.0 (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.9e-94) || !(z <= 8.5e-113)) {
tmp = x + (y * (z / 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.9d-94)) .or. (.not. (z <= 8.5d-113))) then
tmp = x + (y * (z / 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.9e-94) || !(z <= 8.5e-113)) {
tmp = x + (y * (z / t));
} else {
tmp = x * (1.0 - (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.9e-94) or not (z <= 8.5e-113): tmp = x + (y * (z / t)) else: tmp = x * (1.0 - (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.9e-94) || !(z <= 8.5e-113)) tmp = Float64(x + Float64(y * Float64(z / 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.9e-94) || ~((z <= 8.5e-113))) tmp = x + (y * (z / t)); else tmp = x * (1.0 - (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.9e-94], N[Not[LessEqual[z, 8.5e-113]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-94} \lor \neg \left(z \leq 8.5 \cdot 10^{-113}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\end{array}
\end{array}
if z < -1.9e-94 or 8.4999999999999995e-113 < z Initial program 92.7%
Taylor expanded in z around inf 82.5%
associate-/l*85.3%
Simplified85.3%
if -1.9e-94 < z < 8.4999999999999995e-113Initial program 98.9%
Taylor expanded in x around inf 94.8%
mul-1-neg94.8%
unsub-neg94.8%
Simplified94.8%
Final simplification88.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.05e-94) (not (<= z 1.28e-113))) (+ x (* z (/ y t))) (* x (- 1.0 (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.05e-94) || !(z <= 1.28e-113)) {
tmp = x + (z * (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.05d-94)) .or. (.not. (z <= 1.28d-113))) then
tmp = x + (z * (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.05e-94) || !(z <= 1.28e-113)) {
tmp = x + (z * (y / t));
} else {
tmp = x * (1.0 - (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.05e-94) or not (z <= 1.28e-113): tmp = x + (z * (y / t)) else: tmp = x * (1.0 - (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.05e-94) || !(z <= 1.28e-113)) tmp = Float64(x + Float64(z * 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.05e-94) || ~((z <= 1.28e-113))) tmp = x + (z * (y / t)); else tmp = x * (1.0 - (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.05e-94], N[Not[LessEqual[z, 1.28e-113]], $MachinePrecision]], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-94} \lor \neg \left(z \leq 1.28 \cdot 10^{-113}\right):\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\end{array}
\end{array}
if z < -1.05e-94 or 1.2800000000000001e-113 < z Initial program 92.7%
Taylor expanded in z around inf 82.5%
*-commutative82.5%
associate-/l*87.5%
Applied egg-rr87.5%
if -1.05e-94 < z < 1.2800000000000001e-113Initial program 98.9%
Taylor expanded in x around inf 94.8%
mul-1-neg94.8%
unsub-neg94.8%
Simplified94.8%
Final simplification90.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.7e-94) (not (<= z 6e-113))) (+ x (* z (/ y t))) (- x (/ (* y x) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.7e-94) || !(z <= 6e-113)) {
tmp = x + (z * (y / t));
} else {
tmp = x - ((y * x) / 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.7d-94)) .or. (.not. (z <= 6d-113))) then
tmp = x + (z * (y / t))
else
tmp = x - ((y * x) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.7e-94) || !(z <= 6e-113)) {
tmp = x + (z * (y / t));
} else {
tmp = x - ((y * x) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.7e-94) or not (z <= 6e-113): tmp = x + (z * (y / t)) else: tmp = x - ((y * x) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.7e-94) || !(z <= 6e-113)) tmp = Float64(x + Float64(z * Float64(y / t))); else tmp = Float64(x - Float64(Float64(y * x) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.7e-94) || ~((z <= 6e-113))) tmp = x + (z * (y / t)); else tmp = x - ((y * x) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.7e-94], N[Not[LessEqual[z, 6e-113]], $MachinePrecision]], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-94} \lor \neg \left(z \leq 6 \cdot 10^{-113}\right):\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot x}{t}\\
\end{array}
\end{array}
if z < -1.6999999999999999e-94 or 6.0000000000000002e-113 < z Initial program 92.7%
Taylor expanded in z around inf 82.5%
*-commutative82.5%
associate-/l*87.5%
Applied egg-rr87.5%
if -1.6999999999999999e-94 < z < 6.0000000000000002e-113Initial program 98.9%
Taylor expanded in z around 0 96.9%
mul-1-neg96.9%
distribute-lft-neg-out96.9%
*-commutative96.9%
Simplified96.9%
Final simplification90.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.3e-88) (not (<= y 4e+21))) (/ (* y z) t) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.3e-88) || !(y <= 4e+21)) {
tmp = (y * z) / 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 <= (-1.3d-88)) .or. (.not. (y <= 4d+21))) then
tmp = (y * z) / 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 <= -1.3e-88) || !(y <= 4e+21)) {
tmp = (y * z) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.3e-88) or not (y <= 4e+21): tmp = (y * z) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.3e-88) || !(y <= 4e+21)) tmp = Float64(Float64(y * z) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.3e-88) || ~((y <= 4e+21))) tmp = (y * z) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.3e-88], N[Not[LessEqual[y, 4e+21]], $MachinePrecision]], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-88} \lor \neg \left(y \leq 4 \cdot 10^{+21}\right):\\
\;\;\;\;\frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.30000000000000007e-88 or 4e21 < y Initial program 92.0%
Taylor expanded in t around 0 89.3%
Taylor expanded in x around 0 44.5%
if -1.30000000000000007e-88 < y < 4e21Initial program 98.5%
Taylor expanded in y around 0 66.4%
Final simplification54.4%
(FPCore (x y z t) :precision binary64 (if (<= x 1e+20) x (* t (/ x t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1e+20) {
tmp = x;
} else {
tmp = t * (x / 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 (x <= 1d+20) then
tmp = x
else
tmp = t * (x / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1e+20) {
tmp = x;
} else {
tmp = t * (x / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 1e+20: tmp = x else: tmp = t * (x / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 1e+20) tmp = x; else tmp = Float64(t * Float64(x / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 1e+20) tmp = x; else tmp = t * (x / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 1e+20], x, N[(t * N[(x / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{+20}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x}{t}\\
\end{array}
\end{array}
if x < 1e20Initial program 94.5%
Taylor expanded in y around 0 35.2%
if 1e20 < x Initial program 96.4%
Taylor expanded in t around 0 82.4%
Taylor expanded in t around inf 27.5%
*-commutative27.5%
Simplified27.5%
*-commutative27.5%
associate-/l*52.0%
Applied egg-rr52.0%
Final simplification38.7%
(FPCore (x y z t) :precision binary64 (+ x (* (- z x) (/ y t))))
double code(double x, double y, double z, double t) {
return x + ((z - x) * (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 + ((z - x) * (y / t))
end function
public static double code(double x, double y, double z, double t) {
return x + ((z - x) * (y / t));
}
def code(x, y, z, t): return x + ((z - x) * (y / t))
function code(x, y, z, t) return Float64(x + Float64(Float64(z - x) * Float64(y / t))) end
function tmp = code(x, y, z, t) tmp = x + ((z - x) * (y / t)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - x\right) \cdot \frac{y}{t}
\end{array}
Initial program 94.9%
Taylor expanded in z around 0 90.9%
+-commutative90.9%
*-commutative90.9%
associate-*r/89.8%
mul-1-neg89.8%
associate-/l*89.3%
distribute-lft-neg-in89.3%
distribute-rgt-in97.6%
sub-neg97.6%
Simplified97.6%
Final simplification97.6%
(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 94.9%
Taylor expanded in y around 0 36.8%
Final simplification36.8%
(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 2024071
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:alt
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))