
(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 (if (<= y 7.5e-51) (/ (- x z) (* t 2.0)) (if (<= y 1.9e+144) (/ (- y z) (* t 2.0)) (/ (+ x y) (* t 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 7.5e-51) {
tmp = (x - z) / (t * 2.0);
} else if (y <= 1.9e+144) {
tmp = (y - 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 <= 7.5d-51) then
tmp = (x - z) / (t * 2.0d0)
else if (y <= 1.9d+144) then
tmp = (y - 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 <= 7.5e-51) {
tmp = (x - z) / (t * 2.0);
} else if (y <= 1.9e+144) {
tmp = (y - z) / (t * 2.0);
} else {
tmp = (x + y) / (t * 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 7.5e-51: tmp = (x - z) / (t * 2.0) elif y <= 1.9e+144: tmp = (y - z) / (t * 2.0) else: tmp = (x + y) / (t * 2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 7.5e-51) tmp = Float64(Float64(x - z) / Float64(t * 2.0)); elseif (y <= 1.9e+144) tmp = Float64(Float64(y - 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 <= 7.5e-51) tmp = (x - z) / (t * 2.0); elseif (y <= 1.9e+144) tmp = (y - z) / (t * 2.0); else tmp = (x + y) / (t * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 7.5e-51], N[(N[(x - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+144], N[(N[(y - 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 7.5 \cdot 10^{-51}:\\
\;\;\;\;\frac{x - z}{t \cdot 2}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+144}:\\
\;\;\;\;\frac{y - z}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y}{t \cdot 2}\\
\end{array}
\end{array}
if y < 7.49999999999999976e-51Initial program 100.0%
Taylor expanded in y around 0
--lowering--.f6475.3%
Simplified75.3%
if 7.49999999999999976e-51 < y < 1.90000000000000013e144Initial program 99.9%
Taylor expanded in x around 0
--lowering--.f6475.2%
Simplified75.2%
if 1.90000000000000013e144 < y Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f6497.3%
Simplified97.3%
Final simplification78.1%
(FPCore (x y z t) :precision binary64 (if (<= y 7e-51) (/ (- x z) (* t 2.0)) (if (<= y 3.8e+143) (/ 0.5 (/ t (- y z))) (/ (+ x y) (* t 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 7e-51) {
tmp = (x - z) / (t * 2.0);
} else if (y <= 3.8e+143) {
tmp = 0.5 / (t / (y - z));
} 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 <= 7d-51) then
tmp = (x - z) / (t * 2.0d0)
else if (y <= 3.8d+143) then
tmp = 0.5d0 / (t / (y - z))
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 <= 7e-51) {
tmp = (x - z) / (t * 2.0);
} else if (y <= 3.8e+143) {
tmp = 0.5 / (t / (y - z));
} else {
tmp = (x + y) / (t * 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 7e-51: tmp = (x - z) / (t * 2.0) elif y <= 3.8e+143: tmp = 0.5 / (t / (y - z)) else: tmp = (x + y) / (t * 2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 7e-51) tmp = Float64(Float64(x - z) / Float64(t * 2.0)); elseif (y <= 3.8e+143) tmp = Float64(0.5 / Float64(t / Float64(y - z))); 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 <= 7e-51) tmp = (x - z) / (t * 2.0); elseif (y <= 3.8e+143) tmp = 0.5 / (t / (y - z)); else tmp = (x + y) / (t * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 7e-51], N[(N[(x - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e+143], N[(0.5 / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7 \cdot 10^{-51}:\\
\;\;\;\;\frac{x - z}{t \cdot 2}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+143}:\\
\;\;\;\;\frac{0.5}{\frac{t}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y}{t \cdot 2}\\
\end{array}
\end{array}
if y < 6.9999999999999995e-51Initial program 100.0%
Taylor expanded in y around 0
--lowering--.f6475.3%
Simplified75.3%
if 6.9999999999999995e-51 < y < 3.8e143Initial program 99.9%
clear-numN/A
*-commutativeN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6499.6%
Applied egg-rr99.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
--lowering--.f6475.0%
Simplified75.0%
if 3.8e143 < y Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f6497.3%
Simplified97.3%
Final simplification78.1%
(FPCore (x y z t) :precision binary64 (if (<= y 1e-259) (/ (* x 0.5) t) (if (<= y 1.32e+23) (/ (* z -0.5) t) (/ (* y 0.5) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1e-259) {
tmp = (x * 0.5) / t;
} else if (y <= 1.32e+23) {
tmp = (z * -0.5) / t;
} else {
tmp = (y * 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 (y <= 1d-259) then
tmp = (x * 0.5d0) / t
else if (y <= 1.32d+23) then
tmp = (z * (-0.5d0)) / t
else
tmp = (y * 0.5d0) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1e-259) {
tmp = (x * 0.5) / t;
} else if (y <= 1.32e+23) {
tmp = (z * -0.5) / t;
} else {
tmp = (y * 0.5) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1e-259: tmp = (x * 0.5) / t elif y <= 1.32e+23: tmp = (z * -0.5) / t else: tmp = (y * 0.5) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1e-259) tmp = Float64(Float64(x * 0.5) / t); elseif (y <= 1.32e+23) tmp = Float64(Float64(z * -0.5) / t); else tmp = Float64(Float64(y * 0.5) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1e-259) tmp = (x * 0.5) / t; elseif (y <= 1.32e+23) tmp = (z * -0.5) / t; else tmp = (y * 0.5) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1e-259], N[(N[(x * 0.5), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 1.32e+23], N[(N[(z * -0.5), $MachinePrecision] / t), $MachinePrecision], N[(N[(y * 0.5), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{-259}:\\
\;\;\;\;\frac{x \cdot 0.5}{t}\\
\mathbf{elif}\;y \leq 1.32 \cdot 10^{+23}:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 0.5}{t}\\
\end{array}
\end{array}
if y < 1.0000000000000001e-259Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6440.6%
Simplified40.6%
if 1.0000000000000001e-259 < y < 1.3199999999999999e23Initial program 100.0%
Taylor expanded in z around inf
associate-*r/N/A
metadata-evalN/A
associate-*r*N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f6446.1%
Simplified46.1%
if 1.3199999999999999e23 < y Initial program 99.9%
Taylor expanded in y around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6464.3%
Simplified64.3%
Final simplification47.7%
(FPCore (x y z t) :precision binary64 (if (<= x -1.26e-20) (/ (+ x y) (* t 2.0)) (/ 0.5 (/ t (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.26e-20) {
tmp = (x + y) / (t * 2.0);
} else {
tmp = 0.5 / (t / (y - z));
}
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.26d-20)) then
tmp = (x + y) / (t * 2.0d0)
else
tmp = 0.5d0 / (t / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.26e-20) {
tmp = (x + y) / (t * 2.0);
} else {
tmp = 0.5 / (t / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.26e-20: tmp = (x + y) / (t * 2.0) else: tmp = 0.5 / (t / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.26e-20) tmp = Float64(Float64(x + y) / Float64(t * 2.0)); else tmp = Float64(0.5 / Float64(t / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.26e-20) tmp = (x + y) / (t * 2.0); else tmp = 0.5 / (t / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.26e-20], N[(N[(x + y), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], N[(0.5 / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.26 \cdot 10^{-20}:\\
\;\;\;\;\frac{x + y}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\frac{t}{y - z}}\\
\end{array}
\end{array}
if x < -1.26e-20Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f6481.5%
Simplified81.5%
if -1.26e-20 < x Initial program 100.0%
clear-numN/A
*-commutativeN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6499.7%
Applied egg-rr99.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
--lowering--.f6476.1%
Simplified76.1%
Final simplification77.5%
(FPCore (x y z t) :precision binary64 (if (<= x -1.45e+123) (/ (* x 0.5) t) (/ 0.5 (/ t (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.45e+123) {
tmp = (x * 0.5) / t;
} else {
tmp = 0.5 / (t / (y - z));
}
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.45d+123)) then
tmp = (x * 0.5d0) / t
else
tmp = 0.5d0 / (t / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.45e+123) {
tmp = (x * 0.5) / t;
} else {
tmp = 0.5 / (t / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.45e+123: tmp = (x * 0.5) / t else: tmp = 0.5 / (t / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.45e+123) tmp = Float64(Float64(x * 0.5) / t); else tmp = Float64(0.5 / Float64(t / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.45e+123) tmp = (x * 0.5) / t; else tmp = 0.5 / (t / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.45e+123], N[(N[(x * 0.5), $MachinePrecision] / t), $MachinePrecision], N[(0.5 / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+123}:\\
\;\;\;\;\frac{x \cdot 0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\frac{t}{y - z}}\\
\end{array}
\end{array}
if x < -1.45000000000000005e123Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6475.4%
Simplified75.4%
if -1.45000000000000005e123 < x Initial program 100.0%
clear-numN/A
*-commutativeN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6499.5%
Applied egg-rr99.5%
Taylor expanded in x around 0
/-lowering-/.f64N/A
--lowering--.f6475.2%
Simplified75.2%
Final simplification75.2%
(FPCore (x y z t) :precision binary64 (if (<= x -2.5e-54) (/ (* x 0.5) t) (/ (* y 0.5) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.5e-54) {
tmp = (x * 0.5) / t;
} else {
tmp = (y * 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 <= (-2.5d-54)) then
tmp = (x * 0.5d0) / t
else
tmp = (y * 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 <= -2.5e-54) {
tmp = (x * 0.5) / t;
} else {
tmp = (y * 0.5) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.5e-54: tmp = (x * 0.5) / t else: tmp = (y * 0.5) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.5e-54) tmp = Float64(Float64(x * 0.5) / t); else tmp = Float64(Float64(y * 0.5) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.5e-54) tmp = (x * 0.5) / t; else tmp = (y * 0.5) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.5e-54], N[(N[(x * 0.5), $MachinePrecision] / t), $MachinePrecision], N[(N[(y * 0.5), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{-54}:\\
\;\;\;\;\frac{x \cdot 0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 0.5}{t}\\
\end{array}
\end{array}
if x < -2.50000000000000008e-54Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6453.3%
Simplified53.3%
if -2.50000000000000008e-54 < x Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6444.2%
Simplified44.2%
Final simplification47.1%
(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(0.5 / Float64(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[(0.5 / N[(t / N[(x + N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.5}{\frac{t}{x + \left(y - z\right)}}
\end{array}
Initial program 100.0%
clear-numN/A
*-commutativeN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6499.5%
Applied egg-rr99.5%
(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(Float64(x * 0.5) / t) end
function tmp = code(x, y, z, t) tmp = (x * 0.5) / t; end
code[x_, y_, z_, t_] := N[(N[(x * 0.5), $MachinePrecision] / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 0.5}{t}
\end{array}
Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6437.9%
Simplified37.9%
Final simplification37.9%
herbie shell --seed 2024149
(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)))