
(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 (* (/ 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 99.6%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
metadata-eval99.7
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
lower-+.f64N/A
lower--.f6499.7
Applied rewrites99.7%
(FPCore (x y z t) :precision binary64 (if (<= (/ (- (+ x y) z) (* t 2.0)) 0.0) (/ (* 0.5 x) t) (/ (* 0.5 y) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((((x + y) - z) / (t * 2.0)) <= 0.0) {
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 + y) - z) / (t * 2.0d0)) <= 0.0d0) 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 + y) - z) / (t * 2.0)) <= 0.0) {
tmp = (0.5 * x) / t;
} else {
tmp = (0.5 * y) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (((x + y) - z) / (t * 2.0)) <= 0.0: tmp = (0.5 * x) / t else: tmp = (0.5 * y) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(Float64(x + y) - z) / Float64(t * 2.0)) <= 0.0) tmp = Float64(Float64(0.5 * x) / t); else tmp = Float64(Float64(0.5 * y) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((((x + y) - z) / (t * 2.0)) <= 0.0) tmp = (0.5 * x) / t; else tmp = (0.5 * y) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(N[(x + y), $MachinePrecision] - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(0.5 * x), $MachinePrecision] / t), $MachinePrecision], N[(N[(0.5 * y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\left(x + y\right) - z}{t \cdot 2} \leq 0:\\
\;\;\;\;\frac{0.5 \cdot x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5 \cdot y}{t}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 x y) z) (*.f64 t #s(literal 2 binary64))) < 0.0Initial program 99.3%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6445.1
Applied rewrites45.1%
if 0.0 < (/.f64 (-.f64 (+.f64 x y) z) (*.f64 t #s(literal 2 binary64))) Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
associate-*l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6432.1
Applied rewrites32.1%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) -5e-7) (/ (* 0.5 x) t) (if (<= (+ x y) 1e-25) (/ (* z -0.5) t) (/ (* 0.5 y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= -5e-7) {
tmp = (0.5 * x) / t;
} else if ((x + y) <= 1e-25) {
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 + y) <= (-5d-7)) then
tmp = (0.5d0 * x) / t
else if ((x + y) <= 1d-25) 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 + y) <= -5e-7) {
tmp = (0.5 * x) / t;
} else if ((x + y) <= 1e-25) {
tmp = (z * -0.5) / t;
} else {
tmp = (0.5 * y) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + y) <= -5e-7: tmp = (0.5 * x) / t elif (x + y) <= 1e-25: tmp = (z * -0.5) / t else: tmp = (0.5 * y) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x + y) <= -5e-7) tmp = Float64(Float64(0.5 * x) / t); elseif (Float64(x + y) <= 1e-25) tmp = Float64(Float64(z * -0.5) / t); else tmp = Float64(Float64(0.5 * y) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x + y) <= -5e-7) tmp = (0.5 * x) / t; elseif ((x + y) <= 1e-25) tmp = (z * -0.5) / t; else tmp = (0.5 * y) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], -5e-7], N[(N[(0.5 * x), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 1e-25], N[(N[(z * -0.5), $MachinePrecision] / t), $MachinePrecision], N[(N[(0.5 * y), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -5 \cdot 10^{-7}:\\
\;\;\;\;\frac{0.5 \cdot x}{t}\\
\mathbf{elif}\;x + y \leq 10^{-25}:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5 \cdot y}{t}\\
\end{array}
\end{array}
if (+.f64 x y) < -4.99999999999999977e-7Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6452.9
Applied rewrites52.9%
if -4.99999999999999977e-7 < (+.f64 x y) < 1.00000000000000004e-25Initial program 100.0%
Taylor expanded in z around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6466.7
Applied rewrites66.7%
if 1.00000000000000004e-25 < (+.f64 x y) Initial program 99.0%
Taylor expanded in y around inf
*-commutativeN/A
associate-*l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6436.1
Applied rewrites36.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (- x z) (* t 2.0)))) (if (<= z -5.5e+103) t_1 (if (<= z 4.5e+89) (/ (+ x y) (* t 2.0)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x - z) / (t * 2.0);
double tmp;
if (z <= -5.5e+103) {
tmp = t_1;
} else if (z <= 4.5e+89) {
tmp = (x + y) / (t * 2.0);
} 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) :: tmp
t_1 = (x - z) / (t * 2.0d0)
if (z <= (-5.5d+103)) then
tmp = t_1
else if (z <= 4.5d+89) then
tmp = (x + y) / (t * 2.0d0)
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 = (x - z) / (t * 2.0);
double tmp;
if (z <= -5.5e+103) {
tmp = t_1;
} else if (z <= 4.5e+89) {
tmp = (x + y) / (t * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - z) / (t * 2.0) tmp = 0 if z <= -5.5e+103: tmp = t_1 elif z <= 4.5e+89: tmp = (x + y) / (t * 2.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - z) / Float64(t * 2.0)) tmp = 0.0 if (z <= -5.5e+103) tmp = t_1; elseif (z <= 4.5e+89) tmp = Float64(Float64(x + y) / Float64(t * 2.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - z) / (t * 2.0); tmp = 0.0; if (z <= -5.5e+103) tmp = t_1; elseif (z <= 4.5e+89) tmp = (x + y) / (t * 2.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e+103], t$95$1, If[LessEqual[z, 4.5e+89], N[(N[(x + y), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - z}{t \cdot 2}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+103}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+89}:\\
\;\;\;\;\frac{x + y}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.50000000000000001e103 or 4.5e89 < z Initial program 98.9%
Taylor expanded in y around 0
lower--.f6481.7
Applied rewrites81.7%
if -5.50000000000000001e103 < z < 4.5e89Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f6493.1
Applied rewrites93.1%
Final simplification89.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* z -0.5) t))) (if (<= z -6.7e+109) t_1 (if (<= z 9e+146) (/ (+ x y) (* t 2.0)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (z * -0.5) / t;
double tmp;
if (z <= -6.7e+109) {
tmp = t_1;
} else if (z <= 9e+146) {
tmp = (x + y) / (t * 2.0);
} 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) :: tmp
t_1 = (z * (-0.5d0)) / t
if (z <= (-6.7d+109)) then
tmp = t_1
else if (z <= 9d+146) then
tmp = (x + y) / (t * 2.0d0)
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 tmp;
if (z <= -6.7e+109) {
tmp = t_1;
} else if (z <= 9e+146) {
tmp = (x + y) / (t * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * -0.5) / t tmp = 0 if z <= -6.7e+109: tmp = t_1 elif z <= 9e+146: tmp = (x + y) / (t * 2.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * -0.5) / t) tmp = 0.0 if (z <= -6.7e+109) tmp = t_1; elseif (z <= 9e+146) tmp = Float64(Float64(x + y) / Float64(t * 2.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * -0.5) / t; tmp = 0.0; if (z <= -6.7e+109) tmp = t_1; elseif (z <= 9e+146) tmp = (x + y) / (t * 2.0); 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]}, If[LessEqual[z, -6.7e+109], t$95$1, If[LessEqual[z, 9e+146], N[(N[(x + y), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot -0.5}{t}\\
\mathbf{if}\;z \leq -6.7 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+146}:\\
\;\;\;\;\frac{x + y}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.70000000000000036e109 or 9.00000000000000051e146 < z Initial program 98.7%
Taylor expanded in z around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6477.0
Applied rewrites77.0%
if -6.70000000000000036e109 < z < 9.00000000000000051e146Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f6490.4
Applied rewrites90.4%
Final simplification86.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* z -0.5) t))) (if (<= z -6.7e+109) t_1 (if (<= z 9e+146) (* (/ 0.5 t) (+ x y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (z * -0.5) / t;
double tmp;
if (z <= -6.7e+109) {
tmp = t_1;
} else if (z <= 9e+146) {
tmp = (0.5 / t) * (x + y);
} 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) :: tmp
t_1 = (z * (-0.5d0)) / t
if (z <= (-6.7d+109)) then
tmp = t_1
else if (z <= 9d+146) then
tmp = (0.5d0 / t) * (x + y)
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 tmp;
if (z <= -6.7e+109) {
tmp = t_1;
} else if (z <= 9e+146) {
tmp = (0.5 / t) * (x + y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * -0.5) / t tmp = 0 if z <= -6.7e+109: tmp = t_1 elif z <= 9e+146: tmp = (0.5 / t) * (x + y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * -0.5) / t) tmp = 0.0 if (z <= -6.7e+109) tmp = t_1; elseif (z <= 9e+146) tmp = Float64(Float64(0.5 / t) * Float64(x + y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * -0.5) / t; tmp = 0.0; if (z <= -6.7e+109) tmp = t_1; elseif (z <= 9e+146) tmp = (0.5 / t) * (x + y); 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]}, If[LessEqual[z, -6.7e+109], t$95$1, If[LessEqual[z, 9e+146], N[(N[(0.5 / t), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot -0.5}{t}\\
\mathbf{if}\;z \leq -6.7 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+146}:\\
\;\;\;\;\frac{0.5}{t} \cdot \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.70000000000000036e109 or 9.00000000000000051e146 < z Initial program 98.7%
Taylor expanded in z around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6477.0
Applied rewrites77.0%
if -6.70000000000000036e109 < z < 9.00000000000000051e146Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f6490.4
Applied rewrites90.4%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
metadata-evalN/A
lift-/.f64N/A
lower-*.f6490.1
Applied rewrites90.1%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) -5e-236) (/ (- x z) (* t 2.0)) (/ (- y z) (* t 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= -5e-236) {
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 + y) <= (-5d-236)) 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 + y) <= -5e-236) {
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 + y) <= -5e-236: 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 (Float64(x + y) <= -5e-236) 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 + y) <= -5e-236) 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[N[(x + y), $MachinePrecision], -5e-236], 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 + y \leq -5 \cdot 10^{-236}:\\
\;\;\;\;\frac{x - z}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - z}{t \cdot 2}\\
\end{array}
\end{array}
if (+.f64 x y) < -4.9999999999999998e-236Initial program 100.0%
Taylor expanded in y around 0
lower--.f6470.2
Applied rewrites70.2%
if -4.9999999999999998e-236 < (+.f64 x y) Initial program 99.2%
Taylor expanded in x around 0
lower--.f6461.8
Applied rewrites61.8%
(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(Float64(0.5 * x) / t) end
function tmp = code(x, y, z, t) tmp = (0.5 * x) / t; end
code[x_, y_, z_, t_] := N[(N[(0.5 * x), $MachinePrecision] / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.5 \cdot x}{t}
\end{array}
Initial program 99.6%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6446.2
Applied rewrites46.2%
(FPCore (x y z t) :precision binary64 (* (/ 0.5 t) x))
double code(double x, double y, double z, double t) {
return (0.5 / t) * 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 = (0.5d0 / t) * x
end function
public static double code(double x, double y, double z, double t) {
return (0.5 / t) * x;
}
def code(x, y, z, t): return (0.5 / t) * x
function code(x, y, z, t) return Float64(Float64(0.5 / t) * x) end
function tmp = code(x, y, z, t) tmp = (0.5 / t) * x; end
code[x_, y_, z_, t_] := N[(N[(0.5 / t), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.5}{t} \cdot x
\end{array}
Initial program 99.6%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6446.2
Applied rewrites46.2%
Applied rewrites46.0%
herbie shell --seed 2024233
(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)))