
(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 (* (/ (- z (+ x y)) t) -0.5))
double code(double x, double y, double z, double t) {
return ((z - (x + 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 = ((z - (x + y)) / t) * (-0.5d0)
end function
public static double code(double x, double y, double z, double t) {
return ((z - (x + y)) / t) * -0.5;
}
def code(x, y, z, t): return ((z - (x + y)) / t) * -0.5
function code(x, y, z, t) return Float64(Float64(Float64(z - Float64(x + y)) / t) * -0.5) end
function tmp = code(x, y, z, t) tmp = ((z - (x + y)) / t) * -0.5; end
code[x_, y_, z_, t_] := N[(N[(N[(z - N[(x + y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * -0.5), $MachinePrecision]
\begin{array}{l}
\\
\frac{z - \left(x + y\right)}{t} \cdot -0.5
\end{array}
Initial program 99.6%
associate-/r*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
distribute-frac-neg2100.0%
distribute-neg-frac100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (<= x -1.05e-22) (* (/ x t) 0.5) (if (<= x -4.5e-162) (* -0.5 (/ z t)) (* -0.5 (/ y (- t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.05e-22) {
tmp = (x / t) * 0.5;
} else if (x <= -4.5e-162) {
tmp = -0.5 * (z / 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.05d-22)) then
tmp = (x / t) * 0.5d0
else if (x <= (-4.5d-162)) then
tmp = (-0.5d0) * (z / 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.05e-22) {
tmp = (x / t) * 0.5;
} else if (x <= -4.5e-162) {
tmp = -0.5 * (z / t);
} else {
tmp = -0.5 * (y / -t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.05e-22: tmp = (x / t) * 0.5 elif x <= -4.5e-162: tmp = -0.5 * (z / t) else: tmp = -0.5 * (y / -t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.05e-22) tmp = Float64(Float64(x / t) * 0.5); elseif (x <= -4.5e-162) tmp = Float64(-0.5 * Float64(z / t)); else tmp = Float64(-0.5 * Float64(y / Float64(-t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.05e-22) tmp = (x / t) * 0.5; elseif (x <= -4.5e-162) tmp = -0.5 * (z / t); else tmp = -0.5 * (y / -t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.05e-22], N[(N[(x / t), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, -4.5e-162], N[(-0.5 * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(y / (-t)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-22}:\\
\;\;\;\;\frac{x}{t} \cdot 0.5\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-162}:\\
\;\;\;\;-0.5 \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{y}{-t}\\
\end{array}
\end{array}
if x < -1.05000000000000004e-22Initial program 99.9%
associate-/r*99.9%
remove-double-neg99.9%
distribute-frac-neg299.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
distribute-frac-neg299.9%
distribute-neg-frac99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
associate--r+99.9%
div-sub96.2%
Applied egg-rr96.2%
Taylor expanded in y around 0 80.8%
Taylor expanded in z around 0 65.9%
*-commutative65.9%
Simplified65.9%
if -1.05000000000000004e-22 < x < -4.50000000000000023e-162Initial program 100.0%
associate-/r*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
distribute-frac-neg2100.0%
distribute-neg-frac100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 39.1%
if -4.50000000000000023e-162 < x Initial program 99.3%
associate-/r*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
distribute-frac-neg2100.0%
distribute-neg-frac100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 44.4%
mul-1-neg44.4%
distribute-neg-frac244.4%
Simplified44.4%
Final simplification50.4%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) -1e-175) (* -0.5 (/ (- z x) t)) (* -0.5 (/ (- z y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= -1e-175) {
tmp = -0.5 * ((z - x) / t);
} else {
tmp = -0.5 * ((z - 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) <= (-1d-175)) then
tmp = (-0.5d0) * ((z - x) / t)
else
tmp = (-0.5d0) * ((z - 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) <= -1e-175) {
tmp = -0.5 * ((z - x) / t);
} else {
tmp = -0.5 * ((z - y) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + y) <= -1e-175: tmp = -0.5 * ((z - x) / t) else: tmp = -0.5 * ((z - y) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x + y) <= -1e-175) tmp = Float64(-0.5 * Float64(Float64(z - x) / t)); else tmp = Float64(-0.5 * Float64(Float64(z - y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x + y) <= -1e-175) tmp = -0.5 * ((z - x) / t); else tmp = -0.5 * ((z - y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], -1e-175], N[(-0.5 * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{-175}:\\
\;\;\;\;-0.5 \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{z - y}{t}\\
\end{array}
\end{array}
if (+.f64 x y) < -1e-175Initial program 100.0%
associate-/r*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
distribute-frac-neg2100.0%
distribute-neg-frac100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 64.5%
if -1e-175 < (+.f64 x y) Initial program 99.2%
associate-/r*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
distribute-frac-neg2100.0%
distribute-neg-frac100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 66.1%
Final simplification65.2%
(FPCore (x y z t) :precision binary64 (if (<= y 8e+90) (* -0.5 (/ (- z x) t)) (* -0.5 (/ y (- t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 8e+90) {
tmp = -0.5 * ((z - 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 (y <= 8d+90) then
tmp = (-0.5d0) * ((z - 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 (y <= 8e+90) {
tmp = -0.5 * ((z - x) / t);
} else {
tmp = -0.5 * (y / -t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 8e+90: tmp = -0.5 * ((z - x) / t) else: tmp = -0.5 * (y / -t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 8e+90) tmp = Float64(-0.5 * Float64(Float64(z - x) / t)); else tmp = Float64(-0.5 * Float64(y / Float64(-t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 8e+90) tmp = -0.5 * ((z - x) / t); else tmp = -0.5 * (y / -t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 8e+90], N[(-0.5 * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(y / (-t)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8 \cdot 10^{+90}:\\
\;\;\;\;-0.5 \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{y}{-t}\\
\end{array}
\end{array}
if y < 7.99999999999999973e90Initial program 100.0%
associate-/r*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
distribute-frac-neg2100.0%
distribute-neg-frac100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 72.3%
if 7.99999999999999973e90 < y Initial program 97.2%
associate-/r*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
distribute-frac-neg2100.0%
distribute-neg-frac100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 80.6%
mul-1-neg80.6%
distribute-neg-frac280.6%
Simplified80.6%
Final simplification73.4%
(FPCore (x y z t) :precision binary64 (if (<= x -1.1e-22) (* x (/ 0.5 t)) (* z (/ -0.5 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.1e-22) {
tmp = x * (0.5 / t);
} else {
tmp = z * (-0.5 / 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.1d-22)) then
tmp = x * (0.5d0 / t)
else
tmp = z * ((-0.5d0) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.1e-22) {
tmp = x * (0.5 / t);
} else {
tmp = z * (-0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.1e-22: tmp = x * (0.5 / t) else: tmp = z * (-0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.1e-22) tmp = Float64(x * Float64(0.5 / t)); else tmp = Float64(z * Float64(-0.5 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.1e-22) tmp = x * (0.5 / t); else tmp = z * (-0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.1e-22], N[(x * N[(0.5 / t), $MachinePrecision]), $MachinePrecision], N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{-22}:\\
\;\;\;\;x \cdot \frac{0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\end{array}
\end{array}
if x < -1.1e-22Initial program 99.9%
associate-/r*99.9%
remove-double-neg99.9%
distribute-frac-neg299.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
distribute-frac-neg299.9%
distribute-neg-frac99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
associate--r+99.9%
div-sub96.2%
Applied egg-rr96.2%
Taylor expanded in y around 0 80.8%
Taylor expanded in z around 0 65.9%
*-commutative65.9%
associate-*l/65.9%
associate-*r/65.8%
Simplified65.8%
if -1.1e-22 < x Initial program 99.5%
associate-/r*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
distribute-frac-neg2100.0%
distribute-neg-frac100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 33.9%
Taylor expanded in z around 0 33.9%
associate-*r/33.9%
*-commutative33.9%
associate-*r/33.8%
Simplified33.8%
Final simplification43.7%
(FPCore (x y z t) :precision binary64 (if (<= x -1.6e-23) (* (/ x t) 0.5) (* z (/ -0.5 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.6e-23) {
tmp = (x / t) * 0.5;
} else {
tmp = z * (-0.5 / 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.6d-23)) then
tmp = (x / t) * 0.5d0
else
tmp = z * ((-0.5d0) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.6e-23) {
tmp = (x / t) * 0.5;
} else {
tmp = z * (-0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.6e-23: tmp = (x / t) * 0.5 else: tmp = z * (-0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.6e-23) tmp = Float64(Float64(x / t) * 0.5); else tmp = Float64(z * Float64(-0.5 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.6e-23) tmp = (x / t) * 0.5; else tmp = z * (-0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.6e-23], N[(N[(x / t), $MachinePrecision] * 0.5), $MachinePrecision], N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{-23}:\\
\;\;\;\;\frac{x}{t} \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\end{array}
\end{array}
if x < -1.59999999999999988e-23Initial program 99.9%
associate-/r*99.9%
remove-double-neg99.9%
distribute-frac-neg299.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
distribute-frac-neg299.9%
distribute-neg-frac99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
associate--r+99.9%
div-sub96.2%
Applied egg-rr96.2%
Taylor expanded in y around 0 80.8%
Taylor expanded in z around 0 65.9%
*-commutative65.9%
Simplified65.9%
if -1.59999999999999988e-23 < x Initial program 99.5%
associate-/r*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
distribute-frac-neg2100.0%
distribute-neg-frac100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 33.9%
Taylor expanded in z around 0 33.9%
associate-*r/33.9%
*-commutative33.9%
associate-*r/33.8%
Simplified33.8%
Final simplification43.7%
(FPCore (x y z t) :precision binary64 (if (<= x -4.2e-23) (* (/ x t) 0.5) (* -0.5 (/ z t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.2e-23) {
tmp = (x / t) * 0.5;
} else {
tmp = -0.5 * (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 <= (-4.2d-23)) then
tmp = (x / t) * 0.5d0
else
tmp = (-0.5d0) * (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.2e-23) {
tmp = (x / t) * 0.5;
} else {
tmp = -0.5 * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.2e-23: tmp = (x / t) * 0.5 else: tmp = -0.5 * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.2e-23) tmp = Float64(Float64(x / t) * 0.5); else tmp = Float64(-0.5 * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.2e-23) tmp = (x / t) * 0.5; else tmp = -0.5 * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.2e-23], N[(N[(x / t), $MachinePrecision] * 0.5), $MachinePrecision], N[(-0.5 * N[(z / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{-23}:\\
\;\;\;\;\frac{x}{t} \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{z}{t}\\
\end{array}
\end{array}
if x < -4.2000000000000002e-23Initial program 99.9%
associate-/r*99.9%
remove-double-neg99.9%
distribute-frac-neg299.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
distribute-frac-neg299.9%
distribute-neg-frac99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
associate--r+99.9%
div-sub96.2%
Applied egg-rr96.2%
Taylor expanded in y around 0 80.8%
Taylor expanded in z around 0 65.9%
*-commutative65.9%
Simplified65.9%
if -4.2000000000000002e-23 < x Initial program 99.5%
associate-/r*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
distribute-frac-neg2100.0%
distribute-neg-frac100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 33.9%
Final simplification43.8%
(FPCore (x y z t) :precision binary64 (* x (/ 0.5 t)))
double code(double x, double y, double z, double t) {
return x * (0.5 / 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 * (0.5d0 / t)
end function
public static double code(double x, double y, double z, double t) {
return x * (0.5 / t);
}
def code(x, y, z, t): return x * (0.5 / t)
function code(x, y, z, t) return Float64(x * Float64(0.5 / t)) end
function tmp = code(x, y, z, t) tmp = x * (0.5 / t); end
code[x_, y_, z_, t_] := N[(x * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{0.5}{t}
\end{array}
Initial program 99.6%
associate-/r*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
distribute-frac-neg2100.0%
distribute-neg-frac100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
associate--r+100.0%
div-sub97.3%
Applied egg-rr97.3%
Taylor expanded in y around 0 64.7%
Taylor expanded in z around 0 40.6%
*-commutative40.6%
associate-*l/40.6%
associate-*r/40.5%
Simplified40.5%
Final simplification40.5%
herbie shell --seed 2024077
(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)))