
(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 (/ -0.5 (/ t (- z (+ x y)))))
double code(double x, double y, double z, double t) {
return -0.5 / (t / (z - (x + y)));
}
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 / (z - (x + y)))
end function
public static double code(double x, double y, double z, double t) {
return -0.5 / (t / (z - (x + y)));
}
def code(x, y, z, t): return -0.5 / (t / (z - (x + y)))
function code(x, y, z, t) return Float64(-0.5 / Float64(t / Float64(z - Float64(x + y)))) end
function tmp = code(x, y, z, t) tmp = -0.5 / (t / (z - (x + y))); end
code[x_, y_, z_, t_] := N[(-0.5 / N[(t / N[(z - N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-0.5}{\frac{t}{z - \left(x + y\right)}}
\end{array}
Initial program 99.6%
sub-neg99.6%
+-commutative99.6%
neg-sub099.6%
associate-+l-99.6%
sub0-neg99.6%
neg-mul-199.6%
associate-*l/99.3%
*-commutative99.3%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
associate-*l/100.0%
associate-/l*99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (x y z t)
:precision binary64
(if (<= x -3.9e+34)
(* 0.5 (/ x t))
(if (or (<= x -8.5e-196) (and (not (<= x -1.45e-233)) (<= x -6.8e-283)))
(/ z (/ t -0.5))
(* 0.5 (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.9e+34) {
tmp = 0.5 * (x / t);
} else if ((x <= -8.5e-196) || (!(x <= -1.45e-233) && (x <= -6.8e-283))) {
tmp = z / (t / -0.5);
} 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 <= (-3.9d+34)) then
tmp = 0.5d0 * (x / t)
else if ((x <= (-8.5d-196)) .or. (.not. (x <= (-1.45d-233))) .and. (x <= (-6.8d-283))) then
tmp = z / (t / (-0.5d0))
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 <= -3.9e+34) {
tmp = 0.5 * (x / t);
} else if ((x <= -8.5e-196) || (!(x <= -1.45e-233) && (x <= -6.8e-283))) {
tmp = z / (t / -0.5);
} else {
tmp = 0.5 * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.9e+34: tmp = 0.5 * (x / t) elif (x <= -8.5e-196) or (not (x <= -1.45e-233) and (x <= -6.8e-283)): tmp = z / (t / -0.5) else: tmp = 0.5 * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.9e+34) tmp = Float64(0.5 * Float64(x / t)); elseif ((x <= -8.5e-196) || (!(x <= -1.45e-233) && (x <= -6.8e-283))) tmp = Float64(z / Float64(t / -0.5)); 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 <= -3.9e+34) tmp = 0.5 * (x / t); elseif ((x <= -8.5e-196) || (~((x <= -1.45e-233)) && (x <= -6.8e-283))) tmp = z / (t / -0.5); else tmp = 0.5 * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.9e+34], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -8.5e-196], And[N[Not[LessEqual[x, -1.45e-233]], $MachinePrecision], LessEqual[x, -6.8e-283]]], N[(z / N[(t / -0.5), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(y / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{+34}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-196} \lor \neg \left(x \leq -1.45 \cdot 10^{-233}\right) \land x \leq -6.8 \cdot 10^{-283}:\\
\;\;\;\;\frac{z}{\frac{t}{-0.5}}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y}{t}\\
\end{array}
\end{array}
if x < -3.90000000000000019e34Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
associate-*l/99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 63.9%
if -3.90000000000000019e34 < x < -8.50000000000000004e-196 or -1.44999999999999991e-233 < x < -6.7999999999999996e-283Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
associate-*l/99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 64.8%
*-commutative64.8%
associate-/r/64.8%
Simplified64.8%
if -8.50000000000000004e-196 < x < -1.44999999999999991e-233 or -6.7999999999999996e-283 < x Initial program 99.2%
sub-neg99.2%
+-commutative99.2%
neg-sub099.2%
associate-+l-99.2%
sub0-neg99.2%
neg-mul-199.2%
associate-*l/98.9%
*-commutative98.9%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 54.5%
Final simplification59.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y 4.3e-19) (and (not (<= y 23.0)) (<= y 2.8e+100))) (* 0.5 (/ (- x z) t)) (* 0.5 (/ (+ x y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= 4.3e-19) || (!(y <= 23.0) && (y <= 2.8e+100))) {
tmp = 0.5 * ((x - z) / t);
} else {
tmp = 0.5 * ((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 <= 4.3d-19) .or. (.not. (y <= 23.0d0)) .and. (y <= 2.8d+100)) then
tmp = 0.5d0 * ((x - z) / t)
else
tmp = 0.5d0 * ((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 <= 4.3e-19) || (!(y <= 23.0) && (y <= 2.8e+100))) {
tmp = 0.5 * ((x - z) / t);
} else {
tmp = 0.5 * ((x + y) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= 4.3e-19) or (not (y <= 23.0) and (y <= 2.8e+100)): tmp = 0.5 * ((x - z) / t) else: tmp = 0.5 * ((x + y) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= 4.3e-19) || (!(y <= 23.0) && (y <= 2.8e+100))) tmp = Float64(0.5 * Float64(Float64(x - z) / t)); else tmp = Float64(0.5 * Float64(Float64(x + y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= 4.3e-19) || (~((y <= 23.0)) && (y <= 2.8e+100))) tmp = 0.5 * ((x - z) / t); else tmp = 0.5 * ((x + y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, 4.3e-19], And[N[Not[LessEqual[y, 23.0]], $MachinePrecision], LessEqual[y, 2.8e+100]]], N[(0.5 * N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(x + y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.3 \cdot 10^{-19} \lor \neg \left(y \leq 23\right) \land y \leq 2.8 \cdot 10^{+100}:\\
\;\;\;\;0.5 \cdot \frac{x - z}{t}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x + y}{t}\\
\end{array}
\end{array}
if y < 4.3e-19 or 23 < y < 2.7999999999999998e100Initial program 99.5%
Taylor expanded in y around 0 73.6%
if 4.3e-19 < y < 23 or 2.7999999999999998e100 < y Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
associate-*l/99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 94.2%
Final simplification78.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 0.5 (/ (- x z) t))))
(if (<= x -1.1e+125)
t_1
(if (<= x -2.3e+102)
(* 0.5 (/ (+ x y) t))
(if (<= x -3.9e-81) t_1 (* 0.5 (/ (- y z) t)))))))
double code(double x, double y, double z, double t) {
double t_1 = 0.5 * ((x - z) / t);
double tmp;
if (x <= -1.1e+125) {
tmp = t_1;
} else if (x <= -2.3e+102) {
tmp = 0.5 * ((x + y) / t);
} else if (x <= -3.9e-81) {
tmp = t_1;
} else {
tmp = 0.5 * ((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) :: t_1
real(8) :: tmp
t_1 = 0.5d0 * ((x - z) / t)
if (x <= (-1.1d+125)) then
tmp = t_1
else if (x <= (-2.3d+102)) then
tmp = 0.5d0 * ((x + y) / t)
else if (x <= (-3.9d-81)) then
tmp = t_1
else
tmp = 0.5d0 * ((y - z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 0.5 * ((x - z) / t);
double tmp;
if (x <= -1.1e+125) {
tmp = t_1;
} else if (x <= -2.3e+102) {
tmp = 0.5 * ((x + y) / t);
} else if (x <= -3.9e-81) {
tmp = t_1;
} else {
tmp = 0.5 * ((y - z) / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = 0.5 * ((x - z) / t) tmp = 0 if x <= -1.1e+125: tmp = t_1 elif x <= -2.3e+102: tmp = 0.5 * ((x + y) / t) elif x <= -3.9e-81: tmp = t_1 else: tmp = 0.5 * ((y - z) / t) return tmp
function code(x, y, z, t) t_1 = Float64(0.5 * Float64(Float64(x - z) / t)) tmp = 0.0 if (x <= -1.1e+125) tmp = t_1; elseif (x <= -2.3e+102) tmp = Float64(0.5 * Float64(Float64(x + y) / t)); elseif (x <= -3.9e-81) tmp = t_1; else tmp = Float64(0.5 * Float64(Float64(y - z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 0.5 * ((x - z) / t); tmp = 0.0; if (x <= -1.1e+125) tmp = t_1; elseif (x <= -2.3e+102) tmp = 0.5 * ((x + y) / t); elseif (x <= -3.9e-81) tmp = t_1; else tmp = 0.5 * ((y - z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(0.5 * N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.1e+125], t$95$1, If[LessEqual[x, -2.3e+102], N[(0.5 * N[(N[(x + y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.9e-81], t$95$1, N[(0.5 * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.5 \cdot \frac{x - z}{t}\\
\mathbf{if}\;x \leq -1.1 \cdot 10^{+125}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{+102}:\\
\;\;\;\;0.5 \cdot \frac{x + y}{t}\\
\mathbf{elif}\;x \leq -3.9 \cdot 10^{-81}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y - z}{t}\\
\end{array}
\end{array}
if x < -1.09999999999999995e125 or -2.2999999999999999e102 < x < -3.89999999999999985e-81Initial program 100.0%
Taylor expanded in y around 0 82.6%
if -1.09999999999999995e125 < x < -2.2999999999999999e102Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
associate-*l/99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 100.0%
if -3.89999999999999985e-81 < x Initial program 99.4%
Taylor expanded in x around 0 81.1%
Final simplification82.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.2e+148) (not (<= z 3.1e+135))) (/ z (/ t -0.5)) (* 0.5 (/ (+ x y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.2e+148) || !(z <= 3.1e+135)) {
tmp = z / (t / -0.5);
} else {
tmp = 0.5 * ((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 ((z <= (-5.2d+148)) .or. (.not. (z <= 3.1d+135))) then
tmp = z / (t / (-0.5d0))
else
tmp = 0.5d0 * ((x + y) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.2e+148) || !(z <= 3.1e+135)) {
tmp = z / (t / -0.5);
} else {
tmp = 0.5 * ((x + y) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.2e+148) or not (z <= 3.1e+135): tmp = z / (t / -0.5) else: tmp = 0.5 * ((x + y) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.2e+148) || !(z <= 3.1e+135)) tmp = Float64(z / Float64(t / -0.5)); else tmp = Float64(0.5 * Float64(Float64(x + y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.2e+148) || ~((z <= 3.1e+135))) tmp = z / (t / -0.5); else tmp = 0.5 * ((x + y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.2e+148], N[Not[LessEqual[z, 3.1e+135]], $MachinePrecision]], N[(z / N[(t / -0.5), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(x + y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+148} \lor \neg \left(z \leq 3.1 \cdot 10^{+135}\right):\\
\;\;\;\;\frac{z}{\frac{t}{-0.5}}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x + y}{t}\\
\end{array}
\end{array}
if z < -5.2e148 or 3.10000000000000022e135 < z Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
associate-*l/99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 75.5%
*-commutative75.5%
associate-/r/75.5%
Simplified75.5%
if -5.2e148 < z < 3.10000000000000022e135Initial program 99.5%
sub-neg99.5%
+-commutative99.5%
neg-sub099.5%
associate-+l-99.5%
sub0-neg99.5%
neg-mul-199.5%
associate-*l/99.1%
*-commutative99.1%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 86.6%
Final simplification83.7%
(FPCore (x y z t) :precision binary64 (* (- z (+ x y)) (/ -0.5 t)))
double code(double x, double y, double z, double t) {
return (z - (x + y)) * (-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 = (z - (x + y)) * ((-0.5d0) / t)
end function
public static double code(double x, double y, double z, double t) {
return (z - (x + y)) * (-0.5 / t);
}
def code(x, y, z, t): return (z - (x + y)) * (-0.5 / t)
function code(x, y, z, t) return Float64(Float64(z - Float64(x + y)) * Float64(-0.5 / t)) end
function tmp = code(x, y, z, t) tmp = (z - (x + y)) * (-0.5 / t); end
code[x_, y_, z_, t_] := N[(N[(z - N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(z - \left(x + y\right)\right) \cdot \frac{-0.5}{t}
\end{array}
Initial program 99.6%
sub-neg99.6%
+-commutative99.6%
neg-sub099.6%
associate-+l-99.6%
sub0-neg99.6%
neg-mul-199.6%
associate-*l/99.3%
*-commutative99.3%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (<= x -4.6e-82) (* 0.5 (/ x t)) (* 0.5 (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.6e-82) {
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.6d-82)) 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.6e-82) {
tmp = 0.5 * (x / t);
} else {
tmp = 0.5 * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.6e-82: 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.6e-82) 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.6e-82) 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.6e-82], 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.6 \cdot 10^{-82}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y}{t}\\
\end{array}
\end{array}
if x < -4.59999999999999994e-82Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
associate-*l/99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 54.0%
if -4.59999999999999994e-82 < x Initial program 99.4%
sub-neg99.4%
+-commutative99.4%
neg-sub099.4%
associate-+l-99.4%
sub0-neg99.4%
neg-mul-199.4%
associate-*l/99.1%
*-commutative99.1%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 50.2%
Final simplification51.5%
(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 99.6%
sub-neg99.6%
+-commutative99.6%
neg-sub099.6%
associate-+l-99.6%
sub0-neg99.6%
neg-mul-199.6%
associate-*l/99.3%
*-commutative99.3%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 34.7%
Final simplification34.7%
herbie shell --seed 2023199
(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)))