
(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 8 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 (/ (- (+ y x) z) (* 2.0 t)))
double code(double x, double y, double z, double t) {
return ((y + x) - z) / (2.0 * 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 = ((y + x) - z) / (2.0d0 * t)
end function
public static double code(double x, double y, double z, double t) {
return ((y + x) - z) / (2.0 * t);
}
def code(x, y, z, t): return ((y + x) - z) / (2.0 * t)
function code(x, y, z, t) return Float64(Float64(Float64(y + x) - z) / Float64(2.0 * t)) end
function tmp = code(x, y, z, t) tmp = ((y + x) - z) / (2.0 * t); end
code[x_, y_, z_, t_] := N[(N[(N[(y + x), $MachinePrecision] - z), $MachinePrecision] / N[(2.0 * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(y + x\right) - z}{2 \cdot t}
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (<= (+ y x) -5e+70) (* (/ x t) 0.5) (if (<= (+ y x) 5e-45) (/ (- z) (* 2.0 t)) (* (/ y t) 0.5))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y + x) <= -5e+70) {
tmp = (x / t) * 0.5;
} else if ((y + x) <= 5e-45) {
tmp = -z / (2.0 * t);
} else {
tmp = (y / t) * 0.5;
}
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 + x) <= (-5d+70)) then
tmp = (x / t) * 0.5d0
else if ((y + x) <= 5d-45) then
tmp = -z / (2.0d0 * t)
else
tmp = (y / t) * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y + x) <= -5e+70) {
tmp = (x / t) * 0.5;
} else if ((y + x) <= 5e-45) {
tmp = -z / (2.0 * t);
} else {
tmp = (y / t) * 0.5;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y + x) <= -5e+70: tmp = (x / t) * 0.5 elif (y + x) <= 5e-45: tmp = -z / (2.0 * t) else: tmp = (y / t) * 0.5 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(y + x) <= -5e+70) tmp = Float64(Float64(x / t) * 0.5); elseif (Float64(y + x) <= 5e-45) tmp = Float64(Float64(-z) / Float64(2.0 * t)); else tmp = Float64(Float64(y / t) * 0.5); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y + x) <= -5e+70) tmp = (x / t) * 0.5; elseif ((y + x) <= 5e-45) tmp = -z / (2.0 * t); else tmp = (y / t) * 0.5; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(y + x), $MachinePrecision], -5e+70], N[(N[(x / t), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[N[(y + x), $MachinePrecision], 5e-45], N[((-z) / N[(2.0 * t), $MachinePrecision]), $MachinePrecision], N[(N[(y / t), $MachinePrecision] * 0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y + x \leq -5 \cdot 10^{+70}:\\
\;\;\;\;\frac{x}{t} \cdot 0.5\\
\mathbf{elif}\;y + x \leq 5 \cdot 10^{-45}:\\
\;\;\;\;\frac{-z}{2 \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t} \cdot 0.5\\
\end{array}
\end{array}
if (+.f64 x y) < -5.0000000000000002e70Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6445.4
Applied rewrites45.4%
if -5.0000000000000002e70 < (+.f64 x y) < 4.99999999999999976e-45Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6472.3
Applied rewrites72.3%
if 4.99999999999999976e-45 < (+.f64 x y) Initial program 100.0%
Taylor expanded in z around 0
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
associate-*r/N/A
distribute-lft-outN/A
associate-*l*N/A
associate-*l*N/A
distribute-lft-outN/A
associate-*l/N/A
*-lft-identityN/A
associate-*l/N/A
*-lft-identityN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites79.5%
Taylor expanded in x around 0
Applied rewrites48.3%
Final simplification53.8%
(FPCore (x y z t) :precision binary64 (if (<= (+ y x) -5e+70) (* (/ x t) 0.5) (if (<= (+ y x) 5e-45) (* (/ -0.5 t) z) (* (/ y t) 0.5))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y + x) <= -5e+70) {
tmp = (x / t) * 0.5;
} else if ((y + x) <= 5e-45) {
tmp = (-0.5 / t) * z;
} else {
tmp = (y / t) * 0.5;
}
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 + x) <= (-5d+70)) then
tmp = (x / t) * 0.5d0
else if ((y + x) <= 5d-45) then
tmp = ((-0.5d0) / t) * z
else
tmp = (y / t) * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y + x) <= -5e+70) {
tmp = (x / t) * 0.5;
} else if ((y + x) <= 5e-45) {
tmp = (-0.5 / t) * z;
} else {
tmp = (y / t) * 0.5;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y + x) <= -5e+70: tmp = (x / t) * 0.5 elif (y + x) <= 5e-45: tmp = (-0.5 / t) * z else: tmp = (y / t) * 0.5 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(y + x) <= -5e+70) tmp = Float64(Float64(x / t) * 0.5); elseif (Float64(y + x) <= 5e-45) tmp = Float64(Float64(-0.5 / t) * z); else tmp = Float64(Float64(y / t) * 0.5); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y + x) <= -5e+70) tmp = (x / t) * 0.5; elseif ((y + x) <= 5e-45) tmp = (-0.5 / t) * z; else tmp = (y / t) * 0.5; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(y + x), $MachinePrecision], -5e+70], N[(N[(x / t), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[N[(y + x), $MachinePrecision], 5e-45], N[(N[(-0.5 / t), $MachinePrecision] * z), $MachinePrecision], N[(N[(y / t), $MachinePrecision] * 0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y + x \leq -5 \cdot 10^{+70}:\\
\;\;\;\;\frac{x}{t} \cdot 0.5\\
\mathbf{elif}\;y + x \leq 5 \cdot 10^{-45}:\\
\;\;\;\;\frac{-0.5}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t} \cdot 0.5\\
\end{array}
\end{array}
if (+.f64 x y) < -5.0000000000000002e70Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6445.4
Applied rewrites45.4%
if -5.0000000000000002e70 < (+.f64 x y) < 4.99999999999999976e-45Initial program 100.0%
Taylor expanded in z around inf
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6472.0
Applied rewrites72.0%
if 4.99999999999999976e-45 < (+.f64 x y) Initial program 100.0%
Taylor expanded in z around 0
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
associate-*r/N/A
distribute-lft-outN/A
associate-*l*N/A
associate-*l*N/A
distribute-lft-outN/A
associate-*l/N/A
*-lft-identityN/A
associate-*l/N/A
*-lft-identityN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites79.5%
Taylor expanded in x around 0
Applied rewrites48.3%
Final simplification53.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (- z) (* 2.0 t)))) (if (<= z -2.1e+55) t_1 (if (<= z 4.1e+113) (* 0.5 (/ (+ y x) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = -z / (2.0 * t);
double tmp;
if (z <= -2.1e+55) {
tmp = t_1;
} else if (z <= 4.1e+113) {
tmp = 0.5 * ((y + x) / t);
} 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 / (2.0d0 * t)
if (z <= (-2.1d+55)) then
tmp = t_1
else if (z <= 4.1d+113) then
tmp = 0.5d0 * ((y + x) / t)
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 / (2.0 * t);
double tmp;
if (z <= -2.1e+55) {
tmp = t_1;
} else if (z <= 4.1e+113) {
tmp = 0.5 * ((y + x) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -z / (2.0 * t) tmp = 0 if z <= -2.1e+55: tmp = t_1 elif z <= 4.1e+113: tmp = 0.5 * ((y + x) / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-z) / Float64(2.0 * t)) tmp = 0.0 if (z <= -2.1e+55) tmp = t_1; elseif (z <= 4.1e+113) tmp = Float64(0.5 * Float64(Float64(y + x) / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -z / (2.0 * t); tmp = 0.0; if (z <= -2.1e+55) tmp = t_1; elseif (z <= 4.1e+113) tmp = 0.5 * ((y + x) / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-z) / N[(2.0 * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+55], t$95$1, If[LessEqual[z, 4.1e+113], N[(0.5 * N[(N[(y + x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-z}{2 \cdot t}\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+113}:\\
\;\;\;\;0.5 \cdot \frac{y + x}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.1000000000000001e55 or 4.09999999999999993e113 < z Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6477.2
Applied rewrites77.2%
if -2.1000000000000001e55 < z < 4.09999999999999993e113Initial program 100.0%
Taylor expanded in z around 0
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
associate-*r/N/A
distribute-lft-outN/A
associate-*l*N/A
associate-*l*N/A
distribute-lft-outN/A
associate-*l/N/A
*-lft-identityN/A
associate-*l/N/A
*-lft-identityN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites91.1%
Final simplification86.3%
(FPCore (x y z t) :precision binary64 (if (<= (+ y x) -2e-128) (/ (- x z) (* 2.0 t)) (/ (- y z) (* 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y + x) <= -2e-128) {
tmp = (x - z) / (2.0 * t);
} else {
tmp = (y - z) / (2.0 * 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 + x) <= (-2d-128)) then
tmp = (x - z) / (2.0d0 * t)
else
tmp = (y - z) / (2.0d0 * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y + x) <= -2e-128) {
tmp = (x - z) / (2.0 * t);
} else {
tmp = (y - z) / (2.0 * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y + x) <= -2e-128: tmp = (x - z) / (2.0 * t) else: tmp = (y - z) / (2.0 * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(y + x) <= -2e-128) tmp = Float64(Float64(x - z) / Float64(2.0 * t)); else tmp = Float64(Float64(y - z) / Float64(2.0 * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y + x) <= -2e-128) tmp = (x - z) / (2.0 * t); else tmp = (y - z) / (2.0 * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(y + x), $MachinePrecision], -2e-128], N[(N[(x - z), $MachinePrecision] / N[(2.0 * t), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] / N[(2.0 * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y + x \leq -2 \cdot 10^{-128}:\\
\;\;\;\;\frac{x - z}{2 \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - z}{2 \cdot t}\\
\end{array}
\end{array}
if (+.f64 x y) < -2.00000000000000011e-128Initial program 100.0%
Taylor expanded in y around 0
lower--.f6465.7
Applied rewrites65.7%
if -2.00000000000000011e-128 < (+.f64 x y) Initial program 100.0%
Taylor expanded in x around 0
lower--.f6473.1
Applied rewrites73.1%
Final simplification69.7%
(FPCore (x y z t) :precision binary64 (if (<= (+ y x) 5e-45) (/ (- x z) (* 2.0 t)) (* 0.5 (/ (+ y x) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y + x) <= 5e-45) {
tmp = (x - z) / (2.0 * t);
} else {
tmp = 0.5 * ((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 ((y + x) <= 5d-45) then
tmp = (x - z) / (2.0d0 * t)
else
tmp = 0.5d0 * ((y + x) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y + x) <= 5e-45) {
tmp = (x - z) / (2.0 * t);
} else {
tmp = 0.5 * ((y + x) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y + x) <= 5e-45: tmp = (x - z) / (2.0 * t) else: tmp = 0.5 * ((y + x) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(y + x) <= 5e-45) tmp = Float64(Float64(x - z) / Float64(2.0 * t)); else tmp = Float64(0.5 * Float64(Float64(y + x) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y + x) <= 5e-45) tmp = (x - z) / (2.0 * t); else tmp = 0.5 * ((y + x) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(y + x), $MachinePrecision], 5e-45], N[(N[(x - z), $MachinePrecision] / N[(2.0 * t), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(y + x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y + x \leq 5 \cdot 10^{-45}:\\
\;\;\;\;\frac{x - z}{2 \cdot t}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y + x}{t}\\
\end{array}
\end{array}
if (+.f64 x y) < 4.99999999999999976e-45Initial program 100.0%
Taylor expanded in y around 0
lower--.f6471.8
Applied rewrites71.8%
if 4.99999999999999976e-45 < (+.f64 x y) Initial program 100.0%
Taylor expanded in z around 0
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
associate-*r/N/A
distribute-lft-outN/A
associate-*l*N/A
associate-*l*N/A
distribute-lft-outN/A
associate-*l/N/A
*-lft-identityN/A
associate-*l/N/A
*-lft-identityN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites79.5%
Final simplification75.1%
(FPCore (x y z t) :precision binary64 (if (<= (+ y x) 5e-45) (* (/ -0.5 t) z) (* (/ y t) 0.5)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y + x) <= 5e-45) {
tmp = (-0.5 / t) * z;
} else {
tmp = (y / t) * 0.5;
}
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 + x) <= 5d-45) then
tmp = ((-0.5d0) / t) * z
else
tmp = (y / t) * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y + x) <= 5e-45) {
tmp = (-0.5 / t) * z;
} else {
tmp = (y / t) * 0.5;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y + x) <= 5e-45: tmp = (-0.5 / t) * z else: tmp = (y / t) * 0.5 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(y + x) <= 5e-45) tmp = Float64(Float64(-0.5 / t) * z); else tmp = Float64(Float64(y / t) * 0.5); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y + x) <= 5e-45) tmp = (-0.5 / t) * z; else tmp = (y / t) * 0.5; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(y + x), $MachinePrecision], 5e-45], N[(N[(-0.5 / t), $MachinePrecision] * z), $MachinePrecision], N[(N[(y / t), $MachinePrecision] * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y + x \leq 5 \cdot 10^{-45}:\\
\;\;\;\;\frac{-0.5}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t} \cdot 0.5\\
\end{array}
\end{array}
if (+.f64 x y) < 4.99999999999999976e-45Initial program 100.0%
Taylor expanded in z around inf
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6443.7
Applied rewrites43.7%
if 4.99999999999999976e-45 < (+.f64 x y) Initial program 100.0%
Taylor expanded in z around 0
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
associate-*r/N/A
distribute-lft-outN/A
associate-*l*N/A
associate-*l*N/A
distribute-lft-outN/A
associate-*l/N/A
*-lft-identityN/A
associate-*l/N/A
*-lft-identityN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites79.5%
Taylor expanded in x around 0
Applied rewrites48.3%
Final simplification45.7%
(FPCore (x y z t) :precision binary64 (* (/ y t) 0.5))
double code(double x, double y, double z, double t) {
return (y / t) * 0.5;
}
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 = (y / t) * 0.5d0
end function
public static double code(double x, double y, double z, double t) {
return (y / t) * 0.5;
}
def code(x, y, z, t): return (y / t) * 0.5
function code(x, y, z, t) return Float64(Float64(y / t) * 0.5) end
function tmp = code(x, y, z, t) tmp = (y / t) * 0.5; end
code[x_, y_, z_, t_] := N[(N[(y / t), $MachinePrecision] * 0.5), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{t} \cdot 0.5
\end{array}
Initial program 100.0%
Taylor expanded in z around 0
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
associate-*r/N/A
distribute-lft-outN/A
associate-*l*N/A
associate-*l*N/A
distribute-lft-outN/A
associate-*l/N/A
*-lft-identityN/A
associate-*l/N/A
*-lft-identityN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.3%
Taylor expanded in x around 0
Applied rewrites41.7%
herbie shell --seed 2024294
(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)))