
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - 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 + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\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 x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - 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 + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - 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 + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -1.12e+157)
(and (not (<= x -6.3e+106)) (or (<= x -7e+56) (not (<= x 1.05e+28)))))
(* x (- 1.0 y))
(+ x (* (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.12e+157) || (!(x <= -6.3e+106) && ((x <= -7e+56) || !(x <= 1.05e+28)))) {
tmp = x * (1.0 - y);
} 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 <= (-1.12d+157)) .or. (.not. (x <= (-6.3d+106))) .and. (x <= (-7d+56)) .or. (.not. (x <= 1.05d+28))) then
tmp = x * (1.0d0 - y)
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 <= -1.12e+157) || (!(x <= -6.3e+106) && ((x <= -7e+56) || !(x <= 1.05e+28)))) {
tmp = x * (1.0 - y);
} else {
tmp = x + ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.12e+157) or (not (x <= -6.3e+106) and ((x <= -7e+56) or not (x <= 1.05e+28))): tmp = x * (1.0 - y) else: tmp = x + ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.12e+157) || (!(x <= -6.3e+106) && ((x <= -7e+56) || !(x <= 1.05e+28)))) tmp = Float64(x * Float64(1.0 - y)); else tmp = Float64(x + Float64(Float64(y - z) * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.12e+157) || (~((x <= -6.3e+106)) && ((x <= -7e+56) || ~((x <= 1.05e+28))))) tmp = x * (1.0 - y); else tmp = x + ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.12e+157], And[N[Not[LessEqual[x, -6.3e+106]], $MachinePrecision], Or[LessEqual[x, -7e+56], N[Not[LessEqual[x, 1.05e+28]], $MachinePrecision]]]], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.12 \cdot 10^{+157} \lor \neg \left(x \leq -6.3 \cdot 10^{+106}\right) \land \left(x \leq -7 \cdot 10^{+56} \lor \neg \left(x \leq 1.05 \cdot 10^{+28}\right)\right):\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -1.11999999999999995e157 or -6.29999999999999974e106 < x < -6.99999999999999999e56 or 1.04999999999999995e28 < x Initial program 100.0%
Taylor expanded in y around inf 72.4%
*-commutative72.4%
Simplified72.4%
Taylor expanded in x around inf 72.4%
neg-mul-172.4%
unsub-neg72.4%
Simplified72.4%
if -1.11999999999999995e157 < x < -6.29999999999999974e106 or -6.99999999999999999e56 < x < 1.04999999999999995e28Initial program 100.0%
Taylor expanded in t around inf 76.0%
Final simplification74.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 y))))
(if (<= y -3.5e+51)
t_1
(if (<= y 1.18e-198)
(- x (* z t))
(if (<= y 5.8e+17) (+ x (* x z)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double tmp;
if (y <= -3.5e+51) {
tmp = t_1;
} else if (y <= 1.18e-198) {
tmp = x - (z * t);
} else if (y <= 5.8e+17) {
tmp = x + (x * z);
} 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 = x * (1.0d0 - y)
if (y <= (-3.5d+51)) then
tmp = t_1
else if (y <= 1.18d-198) then
tmp = x - (z * t)
else if (y <= 5.8d+17) then
tmp = x + (x * z)
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 * (1.0 - y);
double tmp;
if (y <= -3.5e+51) {
tmp = t_1;
} else if (y <= 1.18e-198) {
tmp = x - (z * t);
} else if (y <= 5.8e+17) {
tmp = x + (x * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - y) tmp = 0 if y <= -3.5e+51: tmp = t_1 elif y <= 1.18e-198: tmp = x - (z * t) elif y <= 5.8e+17: tmp = x + (x * z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - y)) tmp = 0.0 if (y <= -3.5e+51) tmp = t_1; elseif (y <= 1.18e-198) tmp = Float64(x - Float64(z * t)); elseif (y <= 5.8e+17) tmp = Float64(x + Float64(x * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - y); tmp = 0.0; if (y <= -3.5e+51) tmp = t_1; elseif (y <= 1.18e-198) tmp = x - (z * t); elseif (y <= 5.8e+17) tmp = x + (x * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.5e+51], t$95$1, If[LessEqual[y, 1.18e-198], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e+17], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.18 \cdot 10^{-198}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+17}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.5e51 or 5.8e17 < y Initial program 100.0%
Taylor expanded in y around inf 85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in x around inf 53.4%
neg-mul-153.4%
unsub-neg53.4%
Simplified53.4%
if -3.5e51 < y < 1.18000000000000006e-198Initial program 100.0%
Taylor expanded in t around inf 75.8%
Taylor expanded in y around 0 72.4%
mul-1-neg72.4%
unsub-neg72.4%
Simplified72.4%
if 1.18000000000000006e-198 < y < 5.8e17Initial program 100.0%
Taylor expanded in t around 0 60.3%
mul-1-neg60.3%
distribute-rgt-neg-in60.3%
sub-neg60.3%
+-commutative60.3%
distribute-neg-in60.3%
remove-double-neg60.3%
sub-neg60.3%
Simplified60.3%
Taylor expanded in z around inf 60.0%
Final simplification62.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.5e-64) (not (<= t 3.8e+44))) (+ x (* (- y z) t)) (+ x (* x (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.5e-64) || !(t <= 3.8e+44)) {
tmp = x + ((y - z) * t);
} else {
tmp = x + (x * (z - y));
}
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 <= (-4.5d-64)) .or. (.not. (t <= 3.8d+44))) then
tmp = x + ((y - z) * t)
else
tmp = x + (x * (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.5e-64) || !(t <= 3.8e+44)) {
tmp = x + ((y - z) * t);
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.5e-64) or not (t <= 3.8e+44): tmp = x + ((y - z) * t) else: tmp = x + (x * (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.5e-64) || !(t <= 3.8e+44)) tmp = Float64(x + Float64(Float64(y - z) * t)); else tmp = Float64(x + Float64(x * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.5e-64) || ~((t <= 3.8e+44))) tmp = x + ((y - z) * t); else tmp = x + (x * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.5e-64], N[Not[LessEqual[t, 3.8e+44]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{-64} \lor \neg \left(t \leq 3.8 \cdot 10^{+44}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\end{array}
\end{array}
if t < -4.5000000000000001e-64 or 3.8000000000000002e44 < t Initial program 100.0%
Taylor expanded in t around inf 83.6%
if -4.5000000000000001e-64 < t < 3.8000000000000002e44Initial program 100.0%
Taylor expanded in t around 0 85.9%
mul-1-neg85.9%
distribute-rgt-neg-in85.9%
sub-neg85.9%
+-commutative85.9%
distribute-neg-in85.9%
remove-double-neg85.9%
sub-neg85.9%
Simplified85.9%
Final simplification84.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7.4e+14) (not (<= z 8.5e+18))) (+ x (* z (- x t))) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.4e+14) || !(z <= 8.5e+18)) {
tmp = x + (z * (x - t));
} else {
tmp = x + (y * (t - 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 ((z <= (-7.4d+14)) .or. (.not. (z <= 8.5d+18))) then
tmp = x + (z * (x - t))
else
tmp = x + (y * (t - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.4e+14) || !(z <= 8.5e+18)) {
tmp = x + (z * (x - t));
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7.4e+14) or not (z <= 8.5e+18): tmp = x + (z * (x - t)) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7.4e+14) || !(z <= 8.5e+18)) tmp = Float64(x + Float64(z * Float64(x - t))); else tmp = Float64(x + Float64(y * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -7.4e+14) || ~((z <= 8.5e+18))) tmp = x + (z * (x - t)); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.4e+14], N[Not[LessEqual[z, 8.5e+18]], $MachinePrecision]], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{+14} \lor \neg \left(z \leq 8.5 \cdot 10^{+18}\right):\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -7.4e14 or 8.5e18 < z Initial program 100.0%
Taylor expanded in y around 0 84.2%
mul-1-neg84.2%
distribute-rgt-neg-in84.2%
sub-neg84.2%
+-commutative84.2%
distribute-neg-in84.2%
remove-double-neg84.2%
sub-neg84.2%
Simplified84.2%
if -7.4e14 < z < 8.5e18Initial program 100.0%
Taylor expanded in y around inf 93.7%
*-commutative93.7%
Simplified93.7%
Final simplification89.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.05e+57) (not (<= x 3.5e-38))) (* x (- 1.0 y)) (+ x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.05e+57) || !(x <= 3.5e-38)) {
tmp = x * (1.0 - y);
} else {
tmp = 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 ((x <= (-1.05d+57)) .or. (.not. (x <= 3.5d-38))) then
tmp = x * (1.0d0 - y)
else
tmp = x + (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+57) || !(x <= 3.5e-38)) {
tmp = x * (1.0 - y);
} else {
tmp = x + (y * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.05e+57) or not (x <= 3.5e-38): tmp = x * (1.0 - y) else: tmp = x + (y * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.05e+57) || !(x <= 3.5e-38)) tmp = Float64(x * Float64(1.0 - y)); else tmp = Float64(x + Float64(y * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.05e+57) || ~((x <= 3.5e-38))) tmp = x * (1.0 - y); else tmp = x + (y * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.05e+57], N[Not[LessEqual[x, 3.5e-38]], $MachinePrecision]], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+57} \lor \neg \left(x \leq 3.5 \cdot 10^{-38}\right):\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot t\\
\end{array}
\end{array}
if x < -1.04999999999999995e57 or 3.5000000000000001e-38 < x Initial program 100.0%
Taylor expanded in y around inf 69.4%
*-commutative69.4%
Simplified69.4%
Taylor expanded in x around inf 66.2%
neg-mul-166.2%
unsub-neg66.2%
Simplified66.2%
if -1.04999999999999995e57 < x < 3.5000000000000001e-38Initial program 100.0%
Taylor expanded in t around inf 76.1%
Taylor expanded in z around 0 43.7%
Final simplification54.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.65e-13) (not (<= y 2.9e+20))) (* x (- 1.0 y)) (+ x (* x z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.65e-13) || !(y <= 2.9e+20)) {
tmp = x * (1.0 - y);
} else {
tmp = x + (x * 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 ((y <= (-1.65d-13)) .or. (.not. (y <= 2.9d+20))) then
tmp = x * (1.0d0 - y)
else
tmp = x + (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.65e-13) || !(y <= 2.9e+20)) {
tmp = x * (1.0 - y);
} else {
tmp = x + (x * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.65e-13) or not (y <= 2.9e+20): tmp = x * (1.0 - y) else: tmp = x + (x * z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.65e-13) || !(y <= 2.9e+20)) tmp = Float64(x * Float64(1.0 - y)); else tmp = Float64(x + Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.65e-13) || ~((y <= 2.9e+20))) tmp = x * (1.0 - y); else tmp = x + (x * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.65e-13], N[Not[LessEqual[y, 2.9e+20]], $MachinePrecision]], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{-13} \lor \neg \left(y \leq 2.9 \cdot 10^{+20}\right):\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot z\\
\end{array}
\end{array}
if y < -1.65e-13 or 2.9e20 < y Initial program 100.0%
Taylor expanded in y around inf 81.7%
*-commutative81.7%
Simplified81.7%
Taylor expanded in x around inf 51.6%
neg-mul-151.6%
unsub-neg51.6%
Simplified51.6%
if -1.65e-13 < y < 2.9e20Initial program 100.0%
Taylor expanded in t around 0 63.2%
mul-1-neg63.2%
distribute-rgt-neg-in63.2%
sub-neg63.2%
+-commutative63.2%
distribute-neg-in63.2%
remove-double-neg63.2%
sub-neg63.2%
Simplified63.2%
Taylor expanded in z around inf 63.0%
Final simplification57.7%
(FPCore (x y z t) :precision binary64 (* x (- 1.0 y)))
double code(double x, double y, double z, double t) {
return x * (1.0 - 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 = x * (1.0d0 - y)
end function
public static double code(double x, double y, double z, double t) {
return x * (1.0 - y);
}
def code(x, y, z, t): return x * (1.0 - y)
function code(x, y, z, t) return Float64(x * Float64(1.0 - y)) end
function tmp = code(x, y, z, t) tmp = x * (1.0 - y); end
code[x_, y_, z_, t_] := N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - y\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around inf 62.2%
*-commutative62.2%
Simplified62.2%
Taylor expanded in x around inf 43.8%
neg-mul-143.8%
unsub-neg43.8%
Simplified43.8%
Final simplification43.8%
(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 100.0%
Taylor expanded in t around inf 61.4%
Taylor expanded in x around inf 21.3%
Final simplification21.3%
(FPCore (x y z t) :precision binary64 (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-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 = x + ((t * (y - z)) + (-x * (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
def code(x, y, z, t): return x + ((t * (y - z)) + (-x * (y - z)))
function code(x, y, z, t) return Float64(x + Float64(Float64(t * Float64(y - z)) + Float64(Float64(-x) * Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = x + ((t * (y - z)) + (-x * (y - z))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] + N[((-x) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)
\end{array}
herbie shell --seed 2024089
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:alt
(+ x (+ (* t (- y z)) (* (- x) (- y z))))
(+ x (* (- y z) (- t x))))