
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
return x + ((y * (z - 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 = x + ((y * (z - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
def code(x, y, z, t): return x + ((y * (z - x)) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(y * Float64(z - x)) / t)) end
function tmp = code(x, y, z, t) tmp = x + ((y * (z - x)) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - x\right)}{t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
return x + ((y * (z - 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 = x + ((y * (z - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
def code(x, y, z, t): return x + ((y * (z - x)) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(y * Float64(z - x)) / t)) end
function tmp = code(x, y, z, t) tmp = x + ((y * (z - x)) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - x\right)}{t}
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (* (- z x) (/ y t))))
double code(double x, double y, double z, double t) {
return x + ((z - x) * (y / 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 + ((z - x) * (y / t))
end function
public static double code(double x, double y, double z, double t) {
return x + ((z - x) * (y / t));
}
def code(x, y, z, t): return x + ((z - x) * (y / t))
function code(x, y, z, t) return Float64(x + Float64(Float64(z - x) * Float64(y / t))) end
function tmp = code(x, y, z, t) tmp = x + ((z - x) * (y / t)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - x\right) \cdot \frac{y}{t}
\end{array}
Initial program 94.6%
*-commutative94.6%
associate-/l*98.4%
Applied egg-rr98.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y (- t)))) (t_2 (* y (/ z t))))
(if (<= y -1.8e+17)
t_2
(if (<= y 4e-6)
x
(if (<= y 4.3e+83)
t_2
(if (<= y 5e+127)
t_1
(if (<= y 1.92e+155) t_2 (if (<= y 5.2e+179) x t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / -t);
double t_2 = y * (z / t);
double tmp;
if (y <= -1.8e+17) {
tmp = t_2;
} else if (y <= 4e-6) {
tmp = x;
} else if (y <= 4.3e+83) {
tmp = t_2;
} else if (y <= 5e+127) {
tmp = t_1;
} else if (y <= 1.92e+155) {
tmp = t_2;
} else if (y <= 5.2e+179) {
tmp = x;
} 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) :: t_2
real(8) :: tmp
t_1 = x * (y / -t)
t_2 = y * (z / t)
if (y <= (-1.8d+17)) then
tmp = t_2
else if (y <= 4d-6) then
tmp = x
else if (y <= 4.3d+83) then
tmp = t_2
else if (y <= 5d+127) then
tmp = t_1
else if (y <= 1.92d+155) then
tmp = t_2
else if (y <= 5.2d+179) then
tmp = x
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 * (y / -t);
double t_2 = y * (z / t);
double tmp;
if (y <= -1.8e+17) {
tmp = t_2;
} else if (y <= 4e-6) {
tmp = x;
} else if (y <= 4.3e+83) {
tmp = t_2;
} else if (y <= 5e+127) {
tmp = t_1;
} else if (y <= 1.92e+155) {
tmp = t_2;
} else if (y <= 5.2e+179) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / -t) t_2 = y * (z / t) tmp = 0 if y <= -1.8e+17: tmp = t_2 elif y <= 4e-6: tmp = x elif y <= 4.3e+83: tmp = t_2 elif y <= 5e+127: tmp = t_1 elif y <= 1.92e+155: tmp = t_2 elif y <= 5.2e+179: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / Float64(-t))) t_2 = Float64(y * Float64(z / t)) tmp = 0.0 if (y <= -1.8e+17) tmp = t_2; elseif (y <= 4e-6) tmp = x; elseif (y <= 4.3e+83) tmp = t_2; elseif (y <= 5e+127) tmp = t_1; elseif (y <= 1.92e+155) tmp = t_2; elseif (y <= 5.2e+179) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / -t); t_2 = y * (z / t); tmp = 0.0; if (y <= -1.8e+17) tmp = t_2; elseif (y <= 4e-6) tmp = x; elseif (y <= 4.3e+83) tmp = t_2; elseif (y <= 5e+127) tmp = t_1; elseif (y <= 1.92e+155) tmp = t_2; elseif (y <= 5.2e+179) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.8e+17], t$95$2, If[LessEqual[y, 4e-6], x, If[LessEqual[y, 4.3e+83], t$95$2, If[LessEqual[y, 5e+127], t$95$1, If[LessEqual[y, 1.92e+155], t$95$2, If[LessEqual[y, 5.2e+179], x, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{-t}\\
t_2 := y \cdot \frac{z}{t}\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+17}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-6}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.3 \cdot 10^{+83}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.92 \cdot 10^{+155}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+179}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.8e17 or 3.99999999999999982e-6 < y < 4.3e83 or 5.0000000000000004e127 < y < 1.92000000000000012e155Initial program 91.7%
Taylor expanded in y around -inf 86.1%
Taylor expanded in z around inf 55.7%
associate-/l*66.2%
Simplified57.8%
if -1.8e17 < y < 3.99999999999999982e-6 or 1.92000000000000012e155 < y < 5.2000000000000004e179Initial program 99.0%
Taylor expanded in y around 0 68.4%
if 4.3e83 < y < 5.0000000000000004e127 or 5.2000000000000004e179 < y Initial program 84.9%
Taylor expanded in y around -inf 79.0%
Taylor expanded in z around 0 66.6%
mul-1-neg66.6%
associate-/l*74.9%
distribute-rgt-neg-in74.9%
mul-1-neg74.9%
associate-*r/74.9%
mul-1-neg74.9%
Simplified74.9%
Final simplification65.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.6e+38) (not (<= x 2.05e+130))) (* x (- 1.0 (/ y t))) (+ x (* z (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.6e+38) || !(x <= 2.05e+130)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + (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 <= (-1.6d+38)) .or. (.not. (x <= 2.05d+130))) then
tmp = x * (1.0d0 - (y / t))
else
tmp = x + (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 <= -1.6e+38) || !(x <= 2.05e+130)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.6e+38) or not (x <= 2.05e+130): tmp = x * (1.0 - (y / t)) else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.6e+38) || !(x <= 2.05e+130)) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(x + Float64(z * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.6e+38) || ~((x <= 2.05e+130))) tmp = x * (1.0 - (y / t)); else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.6e+38], N[Not[LessEqual[x, 2.05e+130]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{+38} \lor \neg \left(x \leq 2.05 \cdot 10^{+130}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if x < -1.59999999999999993e38 or 2.04999999999999989e130 < x Initial program 89.3%
Taylor expanded in x around inf 95.8%
mul-1-neg95.8%
unsub-neg95.8%
Simplified95.8%
if -1.59999999999999993e38 < x < 2.04999999999999989e130Initial program 97.8%
Taylor expanded in z around inf 85.8%
associate-/l*83.1%
Simplified83.1%
clear-num83.1%
un-div-inv83.1%
Applied egg-rr83.1%
associate-/r/87.7%
Applied egg-rr87.7%
Final simplification90.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.2e+37) (not (<= x 5.5e-61))) (* x (- 1.0 (/ y t))) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.2e+37) || !(x <= 5.5e-61)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + (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) :: tmp
if ((x <= (-5.2d+37)) .or. (.not. (x <= 5.5d-61))) then
tmp = x * (1.0d0 - (y / t))
else
tmp = x + (y * (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.2e+37) || !(x <= 5.5e-61)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5.2e+37) or not (x <= 5.5e-61): tmp = x * (1.0 - (y / t)) else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5.2e+37) || !(x <= 5.5e-61)) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(x + Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -5.2e+37) || ~((x <= 5.5e-61))) tmp = x * (1.0 - (y / t)); else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5.2e+37], N[Not[LessEqual[x, 5.5e-61]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+37} \lor \neg \left(x \leq 5.5 \cdot 10^{-61}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if x < -5.1999999999999998e37 or 5.4999999999999997e-61 < x Initial program 92.6%
Taylor expanded in x around inf 90.3%
mul-1-neg90.3%
unsub-neg90.3%
Simplified90.3%
if -5.1999999999999998e37 < x < 5.4999999999999997e-61Initial program 97.1%
Taylor expanded in z around inf 87.2%
associate-/l*85.1%
Simplified85.1%
Final simplification87.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.1e-72) (not (<= x 4.6e-119))) (* x (- 1.0 (/ y t))) (/ (* z y) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.1e-72) || !(x <= 4.6e-119)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = (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 <= (-1.1d-72)) .or. (.not. (x <= 4.6d-119))) then
tmp = x * (1.0d0 - (y / t))
else
tmp = (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 <= -1.1e-72) || !(x <= 4.6e-119)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = (z * y) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.1e-72) or not (x <= 4.6e-119): tmp = x * (1.0 - (y / t)) else: tmp = (z * y) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.1e-72) || !(x <= 4.6e-119)) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(Float64(z * y) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.1e-72) || ~((x <= 4.6e-119))) tmp = x * (1.0 - (y / t)); else tmp = (z * y) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.1e-72], N[Not[LessEqual[x, 4.6e-119]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{-72} \lor \neg \left(x \leq 4.6 \cdot 10^{-119}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot y}{t}\\
\end{array}
\end{array}
if x < -1.10000000000000001e-72 or 4.59999999999999987e-119 < x Initial program 93.0%
Taylor expanded in x around inf 84.6%
mul-1-neg84.6%
unsub-neg84.6%
Simplified84.6%
if -1.10000000000000001e-72 < x < 4.59999999999999987e-119Initial program 98.2%
Taylor expanded in t around 0 96.5%
Taylor expanded in x around 0 70.1%
Final simplification80.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.4e+17) (not (<= y 2.2e-5))) (* y (/ z t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.4e+17) || !(y <= 2.2e-5)) {
tmp = y * (z / t);
} else {
tmp = x;
}
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 <= (-1.4d+17)) .or. (.not. (y <= 2.2d-5))) then
tmp = y * (z / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.4e+17) || !(y <= 2.2e-5)) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.4e+17) or not (y <= 2.2e-5): tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.4e+17) || !(y <= 2.2e-5)) tmp = Float64(y * Float64(z / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.4e+17) || ~((y <= 2.2e-5))) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.4e+17], N[Not[LessEqual[y, 2.2e-5]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+17} \lor \neg \left(y \leq 2.2 \cdot 10^{-5}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.4e17 or 2.1999999999999999e-5 < y Initial program 89.7%
Taylor expanded in y around -inf 81.4%
Taylor expanded in z around inf 48.4%
associate-/l*61.2%
Simplified49.9%
if -1.4e17 < y < 2.1999999999999999e-5Initial program 99.6%
Taylor expanded in y around 0 68.4%
Final simplification59.1%
(FPCore (x y z t) :precision binary64 (if (<= t -1e+124) x (if (<= t 4e-16) (/ (* z y) t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1e+124) {
tmp = x;
} else if (t <= 4e-16) {
tmp = (z * y) / t;
} else {
tmp = x;
}
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 (t <= (-1d+124)) then
tmp = x
else if (t <= 4d-16) then
tmp = (z * y) / t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1e+124) {
tmp = x;
} else if (t <= 4e-16) {
tmp = (z * y) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1e+124: tmp = x elif t <= 4e-16: tmp = (z * y) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1e+124) tmp = x; elseif (t <= 4e-16) tmp = Float64(Float64(z * y) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1e+124) tmp = x; elseif (t <= 4e-16) tmp = (z * y) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1e+124], x, If[LessEqual[t, 4e-16], N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+124}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-16}:\\
\;\;\;\;\frac{z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -9.99999999999999948e123 or 3.9999999999999999e-16 < t Initial program 88.8%
Taylor expanded in y around 0 72.6%
if -9.99999999999999948e123 < t < 3.9999999999999999e-16Initial program 98.5%
Taylor expanded in t around 0 96.6%
Taylor expanded in x around 0 51.9%
Final simplification60.2%
(FPCore (x y z t) :precision binary64 (if (<= x 2.6e-120) x (* t (/ x t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 2.6e-120) {
tmp = x;
} else {
tmp = t * (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 (x <= 2.6d-120) then
tmp = x
else
tmp = t * (x / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 2.6e-120) {
tmp = x;
} else {
tmp = t * (x / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 2.6e-120: tmp = x else: tmp = t * (x / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 2.6e-120) tmp = x; else tmp = Float64(t * Float64(x / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 2.6e-120) tmp = x; else tmp = t * (x / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 2.6e-120], x, N[(t * N[(x / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.6 \cdot 10^{-120}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x}{t}\\
\end{array}
\end{array}
if x < 2.6000000000000001e-120Initial program 97.2%
Taylor expanded in y around 0 39.0%
if 2.6000000000000001e-120 < x Initial program 90.9%
Taylor expanded in t around 0 75.5%
Taylor expanded in t around inf 25.1%
*-commutative25.1%
Simplified25.1%
*-commutative25.1%
associate-/l*49.4%
Applied egg-rr49.4%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return 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 = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 94.6%
Taylor expanded in y around 0 40.7%
(FPCore (x y z t) :precision binary64 (- x (+ (* x (/ y t)) (* (- z) (/ y t)))))
double code(double x, double y, double z, double t) {
return x - ((x * (y / t)) + (-z * (y / 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 - ((x * (y / t)) + (-z * (y / t)))
end function
public static double code(double x, double y, double z, double t) {
return x - ((x * (y / t)) + (-z * (y / t)));
}
def code(x, y, z, t): return x - ((x * (y / t)) + (-z * (y / t)))
function code(x, y, z, t) return Float64(x - Float64(Float64(x * Float64(y / t)) + Float64(Float64(-z) * Float64(y / t)))) end
function tmp = code(x, y, z, t) tmp = x - ((x * (y / t)) + (-z * (y / t))); end
code[x_, y_, z_, t_] := N[(x - N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] + N[((-z) * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)
\end{array}
herbie shell --seed 2024087
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:alt
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))