
(FPCore (x y z t) :precision binary64 (/ (- (+ x y) z) (* t 2.0)))
double code(double x, double y, double z, double t) {
return ((x + y) - z) / (t * 2.0);
}
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) / (t * 2.0d0)
end function
public static double code(double x, double y, double z, double t) {
return ((x + y) - z) / (t * 2.0);
}
def code(x, y, z, t): return ((x + y) - z) / (t * 2.0)
function code(x, y, z, t) return Float64(Float64(Float64(x + y) - z) / Float64(t * 2.0)) end
function tmp = code(x, y, z, t) tmp = ((x + y) - z) / (t * 2.0); end
code[x_, y_, z_, t_] := N[(N[(N[(x + y), $MachinePrecision] - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x + y\right) - z}{t \cdot 2}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (- (+ x y) z) (* t 2.0)))
double code(double x, double y, double z, double t) {
return ((x + y) - z) / (t * 2.0);
}
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) / (t * 2.0d0)
end function
public static double code(double x, double y, double z, double t) {
return ((x + y) - z) / (t * 2.0);
}
def code(x, y, z, t): return ((x + y) - z) / (t * 2.0)
function code(x, y, z, t) return Float64(Float64(Float64(x + y) - z) / Float64(t * 2.0)) end
function tmp = code(x, y, z, t) tmp = ((x + y) - z) / (t * 2.0); end
code[x_, y_, z_, t_] := N[(N[(N[(x + y), $MachinePrecision] - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x + y\right) - z}{t \cdot 2}
\end{array}
(FPCore (x y z t) :precision binary64 (/ (- (+ x y) z) (* t 2.0)))
double code(double x, double y, double z, double t) {
return ((x + y) - z) / (t * 2.0);
}
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) / (t * 2.0d0)
end function
public static double code(double x, double y, double z, double t) {
return ((x + y) - z) / (t * 2.0);
}
def code(x, y, z, t): return ((x + y) - z) / (t * 2.0)
function code(x, y, z, t) return Float64(Float64(Float64(x + y) - z) / Float64(t * 2.0)) end
function tmp = code(x, y, z, t) tmp = ((x + y) - z) / (t * 2.0); end
code[x_, y_, z_, t_] := N[(N[(N[(x + y), $MachinePrecision] - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x + y\right) - z}{t \cdot 2}
\end{array}
Initial program 100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* z -0.5) t)) (t_2 (/ (+ x y) (* t 2.0))))
(if (<= z -2.45e+90)
t_1
(if (<= z 4e+14)
t_2
(if (<= z 5.3e+39) (* z (/ -0.5 t)) (if (<= z 7e+132) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * -0.5) / t;
double t_2 = (x + y) / (t * 2.0);
double tmp;
if (z <= -2.45e+90) {
tmp = t_1;
} else if (z <= 4e+14) {
tmp = t_2;
} else if (z <= 5.3e+39) {
tmp = z * (-0.5 / t);
} else if (z <= 7e+132) {
tmp = t_2;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z * (-0.5d0)) / t
t_2 = (x + y) / (t * 2.0d0)
if (z <= (-2.45d+90)) then
tmp = t_1
else if (z <= 4d+14) then
tmp = t_2
else if (z <= 5.3d+39) then
tmp = z * ((-0.5d0) / t)
else if (z <= 7d+132) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z * -0.5) / t;
double t_2 = (x + y) / (t * 2.0);
double tmp;
if (z <= -2.45e+90) {
tmp = t_1;
} else if (z <= 4e+14) {
tmp = t_2;
} else if (z <= 5.3e+39) {
tmp = z * (-0.5 / t);
} else if (z <= 7e+132) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * -0.5) / t t_2 = (x + y) / (t * 2.0) tmp = 0 if z <= -2.45e+90: tmp = t_1 elif z <= 4e+14: tmp = t_2 elif z <= 5.3e+39: tmp = z * (-0.5 / t) elif z <= 7e+132: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * -0.5) / t) t_2 = Float64(Float64(x + y) / Float64(t * 2.0)) tmp = 0.0 if (z <= -2.45e+90) tmp = t_1; elseif (z <= 4e+14) tmp = t_2; elseif (z <= 5.3e+39) tmp = Float64(z * Float64(-0.5 / t)); elseif (z <= 7e+132) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * -0.5) / t; t_2 = (x + y) / (t * 2.0); tmp = 0.0; if (z <= -2.45e+90) tmp = t_1; elseif (z <= 4e+14) tmp = t_2; elseif (z <= 5.3e+39) tmp = z * (-0.5 / t); elseif (z <= 7e+132) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * -0.5), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.45e+90], t$95$1, If[LessEqual[z, 4e+14], t$95$2, If[LessEqual[z, 5.3e+39], N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e+132], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot -0.5}{t}\\
t_2 := \frac{x + y}{t \cdot 2}\\
\mathbf{if}\;z \leq -2.45 \cdot 10^{+90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+14}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{+39}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+132}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.4500000000000001e90 or 7.00000000000000041e132 < z Initial program 100.0%
Taylor expanded in z around inf 78.9%
associate-*r/78.9%
Simplified78.9%
if -2.4500000000000001e90 < z < 4e14 or 5.29999999999999979e39 < z < 7.00000000000000041e132Initial program 100.0%
Taylor expanded in z around 0 89.1%
+-commutative89.1%
Simplified89.1%
if 4e14 < z < 5.29999999999999979e39Initial program 100.0%
Taylor expanded in x around 0 100.0%
associate-*r/100.0%
associate-*l/99.8%
associate-*r/99.8%
associate-*l/99.8%
distribute-lft-in99.8%
+-commutative99.8%
Simplified99.8%
associate-*l/100.0%
clear-num99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 76.0%
associate-*r/76.0%
*-commutative76.0%
associate-/l*76.0%
Simplified76.0%
Final simplification84.9%
(FPCore (x y z t) :precision binary64 (if (<= x -6.8e+74) (* 0.5 (/ x t)) (if (<= x 1.06e-222) (/ (* z -0.5) t) (* 0.5 (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.8e+74) {
tmp = 0.5 * (x / t);
} else if (x <= 1.06e-222) {
tmp = (z * -0.5) / t;
} else {
tmp = 0.5 * (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 (x <= (-6.8d+74)) then
tmp = 0.5d0 * (x / t)
else if (x <= 1.06d-222) then
tmp = (z * (-0.5d0)) / t
else
tmp = 0.5d0 * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.8e+74) {
tmp = 0.5 * (x / t);
} else if (x <= 1.06e-222) {
tmp = (z * -0.5) / t;
} else {
tmp = 0.5 * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6.8e+74: tmp = 0.5 * (x / t) elif x <= 1.06e-222: tmp = (z * -0.5) / t else: tmp = 0.5 * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6.8e+74) tmp = Float64(0.5 * Float64(x / t)); elseif (x <= 1.06e-222) tmp = Float64(Float64(z * -0.5) / t); else tmp = Float64(0.5 * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -6.8e+74) tmp = 0.5 * (x / t); elseif (x <= 1.06e-222) tmp = (z * -0.5) / t; else tmp = 0.5 * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.8e+74], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.06e-222], N[(N[(z * -0.5), $MachinePrecision] / t), $MachinePrecision], N[(0.5 * N[(y / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+74}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{elif}\;x \leq 1.06 \cdot 10^{-222}:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y}{t}\\
\end{array}
\end{array}
if x < -6.7999999999999998e74Initial program 99.9%
Taylor expanded in x around inf 72.6%
if -6.7999999999999998e74 < x < 1.06000000000000005e-222Initial program 100.0%
Taylor expanded in z around inf 56.1%
associate-*r/56.1%
Simplified56.1%
if 1.06000000000000005e-222 < x Initial program 100.0%
Taylor expanded in y around inf 33.9%
Final simplification51.2%
(FPCore (x y z t) :precision binary64 (if (<= x -1.35e+74) (* 0.5 (/ x t)) (if (<= x 2.05e-223) (* z (/ -0.5 t)) (* 0.5 (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.35e+74) {
tmp = 0.5 * (x / t);
} else if (x <= 2.05e-223) {
tmp = z * (-0.5 / t);
} else {
tmp = 0.5 * (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 (x <= (-1.35d+74)) then
tmp = 0.5d0 * (x / t)
else if (x <= 2.05d-223) then
tmp = z * ((-0.5d0) / t)
else
tmp = 0.5d0 * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.35e+74) {
tmp = 0.5 * (x / t);
} else if (x <= 2.05e-223) {
tmp = z * (-0.5 / t);
} else {
tmp = 0.5 * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.35e+74: tmp = 0.5 * (x / t) elif x <= 2.05e-223: tmp = z * (-0.5 / t) else: tmp = 0.5 * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.35e+74) tmp = Float64(0.5 * Float64(x / t)); elseif (x <= 2.05e-223) tmp = Float64(z * Float64(-0.5 / t)); else tmp = Float64(0.5 * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.35e+74) tmp = 0.5 * (x / t); elseif (x <= 2.05e-223) tmp = z * (-0.5 / t); else tmp = 0.5 * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.35e+74], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.05e-223], N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(y / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+74}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{-223}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y}{t}\\
\end{array}
\end{array}
if x < -1.3499999999999999e74Initial program 99.9%
Taylor expanded in x around inf 72.6%
if -1.3499999999999999e74 < x < 2.05000000000000007e-223Initial program 100.0%
Taylor expanded in x around 0 100.0%
associate-*r/100.0%
associate-*l/99.7%
associate-*r/99.7%
associate-*l/99.7%
distribute-lft-in99.8%
+-commutative99.8%
Simplified99.8%
associate-*l/100.0%
clear-num99.0%
+-commutative99.0%
Applied egg-rr99.0%
Taylor expanded in z around inf 56.1%
associate-*r/56.1%
*-commutative56.1%
associate-/l*56.0%
Simplified56.0%
if 2.05000000000000007e-223 < x Initial program 100.0%
Taylor expanded in y around inf 33.9%
(FPCore (x y z t) :precision binary64 (if (<= x -3.45e-59) (/ (- x z) (* t 2.0)) (/ (- y z) (* t 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.45e-59) {
tmp = (x - z) / (t * 2.0);
} else {
tmp = (y - z) / (t * 2.0);
}
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-59)) then
tmp = (x - z) / (t * 2.0d0)
else
tmp = (y - z) / (t * 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.45e-59) {
tmp = (x - z) / (t * 2.0);
} else {
tmp = (y - z) / (t * 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.45e-59: tmp = (x - z) / (t * 2.0) else: tmp = (y - z) / (t * 2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.45e-59) tmp = Float64(Float64(x - z) / Float64(t * 2.0)); else tmp = Float64(Float64(y - z) / Float64(t * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.45e-59) tmp = (x - z) / (t * 2.0); else tmp = (y - z) / (t * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.45e-59], N[(N[(x - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.45 \cdot 10^{-59}:\\
\;\;\;\;\frac{x - z}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - z}{t \cdot 2}\\
\end{array}
\end{array}
if x < -3.44999999999999991e-59Initial program 100.0%
Taylor expanded in x around inf 84.1%
if -3.44999999999999991e-59 < x Initial program 100.0%
Taylor expanded in x around 0 79.3%
(FPCore (x y z t) :precision binary64 (if (<= y 3.1e+62) (/ (- x z) (* t 2.0)) (/ (+ x y) (* t 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.1e+62) {
tmp = (x - z) / (t * 2.0);
} else {
tmp = (x + y) / (t * 2.0);
}
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 <= 3.1d+62) then
tmp = (x - z) / (t * 2.0d0)
else
tmp = (x + y) / (t * 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.1e+62) {
tmp = (x - z) / (t * 2.0);
} else {
tmp = (x + y) / (t * 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3.1e+62: tmp = (x - z) / (t * 2.0) else: tmp = (x + y) / (t * 2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3.1e+62) tmp = Float64(Float64(x - z) / Float64(t * 2.0)); else tmp = Float64(Float64(x + y) / Float64(t * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 3.1e+62) tmp = (x - z) / (t * 2.0); else tmp = (x + y) / (t * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.1e+62], N[(N[(x - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.1 \cdot 10^{+62}:\\
\;\;\;\;\frac{x - z}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y}{t \cdot 2}\\
\end{array}
\end{array}
if y < 3.10000000000000014e62Initial program 100.0%
Taylor expanded in x around inf 79.9%
if 3.10000000000000014e62 < y Initial program 100.0%
Taylor expanded in z around 0 88.1%
+-commutative88.1%
Simplified88.1%
Final simplification81.5%
(FPCore (x y z t) :precision binary64 (if (<= x -4.8e-63) (* 0.5 (/ x t)) (* 0.5 (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.8e-63) {
tmp = 0.5 * (x / t);
} else {
tmp = 0.5 * (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 (x <= (-4.8d-63)) then
tmp = 0.5d0 * (x / t)
else
tmp = 0.5d0 * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.8e-63) {
tmp = 0.5 * (x / t);
} else {
tmp = 0.5 * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.8e-63: tmp = 0.5 * (x / t) else: tmp = 0.5 * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.8e-63) tmp = Float64(0.5 * Float64(x / t)); else tmp = Float64(0.5 * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.8e-63) tmp = 0.5 * (x / t); else tmp = 0.5 * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.8e-63], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{-63}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y}{t}\\
\end{array}
\end{array}
if x < -4.8000000000000001e-63Initial program 100.0%
Taylor expanded in x around inf 51.0%
if -4.8000000000000001e-63 < x Initial program 100.0%
Taylor expanded in y around inf 41.9%
(FPCore (x y z t) :precision binary64 (* (/ 0.5 t) (+ x (- y z))))
double code(double x, double y, double z, double t) {
return (0.5 / t) * (x + (y - z));
}
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 = (0.5d0 / t) * (x + (y - z))
end function
public static double code(double x, double y, double z, double t) {
return (0.5 / t) * (x + (y - z));
}
def code(x, y, z, t): return (0.5 / t) * (x + (y - z))
function code(x, y, z, t) return Float64(Float64(0.5 / t) * Float64(x + Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = (0.5 / t) * (x + (y - z)); end
code[x_, y_, z_, t_] := N[(N[(0.5 / t), $MachinePrecision] * N[(x + N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.5}{t} \cdot \left(x + \left(y - z\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in x around 0 96.1%
associate-*r/96.1%
associate-*l/95.9%
associate-*r/95.9%
associate-*l/95.8%
distribute-lft-in99.7%
+-commutative99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (* 0.5 (/ x t)))
double code(double x, double y, double z, double t) {
return 0.5 * (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 = 0.5d0 * (x / t)
end function
public static double code(double x, double y, double z, double t) {
return 0.5 * (x / t);
}
def code(x, y, z, t): return 0.5 * (x / t)
function code(x, y, z, t) return Float64(0.5 * Float64(x / t)) end
function tmp = code(x, y, z, t) tmp = 0.5 * (x / t); end
code[x_, y_, z_, t_] := N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \frac{x}{t}
\end{array}
Initial program 100.0%
Taylor expanded in x around inf 34.6%
herbie shell --seed 2024111
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, B"
:precision binary64
(/ (- (+ x y) z) (* t 2.0)))