
(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (- z t)) t))
double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + 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 - t)) + t
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
def code(x, y, z, t): return ((x / y) * (z - t)) + t
function code(x, y, z, t) return Float64(Float64(Float64(x / y) * Float64(z - t)) + t) end
function tmp = code(x, y, z, t) tmp = ((x / y) * (z - t)) + t; end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} \cdot \left(z - t\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 t)) t))
double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + 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 - t)) + t
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
def code(x, y, z, t): return ((x / y) * (z - t)) + t
function code(x, y, z, t) return Float64(Float64(Float64(x / y) * Float64(z - t)) + t) end
function tmp = code(x, y, z, t) tmp = ((x / y) * (z - t)) + t; end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} \cdot \left(z - t\right) + t
\end{array}
(FPCore (x y z t) :precision binary64 (+ t (* (/ x y) (- z t))))
double code(double x, double y, double z, double t) {
return t + ((x / y) * (z - 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 = t + ((x / y) * (z - t))
end function
public static double code(double x, double y, double z, double t) {
return t + ((x / y) * (z - t));
}
def code(x, y, z, t): return t + ((x / y) * (z - t))
function code(x, y, z, t) return Float64(t + Float64(Float64(x / y) * Float64(z - t))) end
function tmp = code(x, y, z, t) tmp = t + ((x / y) * (z - t)); end
code[x_, y_, z_, t_] := N[(t + N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t + \frac{x}{y} \cdot \left(z - t\right)
\end{array}
Initial program 97.7%
Final simplification97.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -10.0) (not (<= (/ x y) 1e+20))) (* (/ x y) (- t)) t))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -10.0) || !((x / y) <= 1e+20)) {
tmp = (x / y) * -t;
} else {
tmp = 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) <= (-10.0d0)) .or. (.not. ((x / y) <= 1d+20))) then
tmp = (x / y) * -t
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -10.0) || !((x / y) <= 1e+20)) {
tmp = (x / y) * -t;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -10.0) or not ((x / y) <= 1e+20): tmp = (x / y) * -t else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -10.0) || !(Float64(x / y) <= 1e+20)) tmp = Float64(Float64(x / y) * Float64(-t)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -10.0) || ~(((x / y) <= 1e+20))) tmp = (x / y) * -t; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -10.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1e+20]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] * (-t)), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -10 \lor \neg \left(\frac{x}{y} \leq 10^{+20}\right):\\
\;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if (/.f64 x y) < -10 or 1e20 < (/.f64 x y) Initial program 98.2%
Taylor expanded in z around 0 48.2%
*-rgt-identity48.2%
mul-1-neg48.2%
associate-/l*53.7%
distribute-rgt-neg-in53.7%
mul-1-neg53.7%
distribute-lft-in53.7%
mul-1-neg53.7%
unsub-neg53.7%
Simplified53.7%
Taylor expanded in x around inf 53.0%
mul-1-neg53.0%
distribute-frac-neg253.0%
Simplified53.0%
if -10 < (/.f64 x y) < 1e20Initial program 97.4%
Taylor expanded in x around 0 73.4%
Final simplification64.1%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -10.0) (/ t (/ y (- x))) (if (<= (/ x y) 1e+20) t (* (/ x y) (- t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -10.0) {
tmp = t / (y / -x);
} else if ((x / y) <= 1e+20) {
tmp = t;
} 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 / y) <= (-10.0d0)) then
tmp = t / (y / -x)
else if ((x / y) <= 1d+20) then
tmp = t
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 / y) <= -10.0) {
tmp = t / (y / -x);
} else if ((x / y) <= 1e+20) {
tmp = t;
} else {
tmp = (x / y) * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -10.0: tmp = t / (y / -x) elif (x / y) <= 1e+20: tmp = t else: tmp = (x / y) * -t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -10.0) tmp = Float64(t / Float64(y / Float64(-x))); elseif (Float64(x / y) <= 1e+20) tmp = t; else tmp = Float64(Float64(x / y) * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -10.0) tmp = t / (y / -x); elseif ((x / y) <= 1e+20) tmp = t; else tmp = (x / y) * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -10.0], N[(t / N[(y / (-x)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1e+20], t, N[(N[(x / y), $MachinePrecision] * (-t)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -10:\\
\;\;\;\;\frac{t}{\frac{y}{-x}}\\
\mathbf{elif}\;\frac{x}{y} \leq 10^{+20}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -10Initial program 96.8%
Taylor expanded in z around 0 47.2%
*-rgt-identity47.2%
mul-1-neg47.2%
associate-/l*51.4%
distribute-rgt-neg-in51.4%
mul-1-neg51.4%
distribute-lft-in51.4%
mul-1-neg51.4%
unsub-neg51.4%
Simplified51.4%
Taylor expanded in x around inf 50.3%
mul-1-neg50.3%
distribute-frac-neg250.3%
Simplified50.3%
clear-num50.3%
un-div-inv50.3%
add-sqr-sqrt28.3%
sqrt-unprod28.1%
sqr-neg28.1%
sqrt-unprod2.3%
add-sqr-sqrt7.8%
Applied egg-rr7.8%
add-sqr-sqrt2.3%
sqrt-unprod28.1%
sqr-neg28.1%
sqrt-unprod28.3%
add-sqr-sqrt50.3%
distribute-frac-neg50.3%
neg-sub050.3%
Applied egg-rr50.3%
neg-sub050.3%
distribute-neg-frac250.3%
Simplified50.3%
if -10 < (/.f64 x y) < 1e20Initial program 97.4%
Taylor expanded in x around 0 73.4%
if 1e20 < (/.f64 x y) Initial program 99.9%
Taylor expanded in z around 0 49.5%
*-rgt-identity49.5%
mul-1-neg49.5%
associate-/l*56.5%
distribute-rgt-neg-in56.5%
mul-1-neg56.5%
distribute-lft-in56.5%
mul-1-neg56.5%
unsub-neg56.5%
Simplified56.5%
Taylor expanded in x around inf 56.5%
mul-1-neg56.5%
distribute-frac-neg256.5%
Simplified56.5%
Final simplification64.1%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -10.0) (* x (/ (- t) y)) (if (<= (/ x y) 1e+20) t (* (/ x y) (- t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -10.0) {
tmp = x * (-t / y);
} else if ((x / y) <= 1e+20) {
tmp = t;
} 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 / y) <= (-10.0d0)) then
tmp = x * (-t / y)
else if ((x / y) <= 1d+20) then
tmp = t
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 / y) <= -10.0) {
tmp = x * (-t / y);
} else if ((x / y) <= 1e+20) {
tmp = t;
} else {
tmp = (x / y) * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -10.0: tmp = x * (-t / y) elif (x / y) <= 1e+20: tmp = t else: tmp = (x / y) * -t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -10.0) tmp = Float64(x * Float64(Float64(-t) / y)); elseif (Float64(x / y) <= 1e+20) tmp = t; else tmp = Float64(Float64(x / y) * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -10.0) tmp = x * (-t / y); elseif ((x / y) <= 1e+20) tmp = t; else tmp = (x / y) * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -10.0], N[(x * N[((-t) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1e+20], t, N[(N[(x / y), $MachinePrecision] * (-t)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -10:\\
\;\;\;\;x \cdot \frac{-t}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 10^{+20}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -10Initial program 96.8%
Taylor expanded in z around 0 47.2%
*-rgt-identity47.2%
mul-1-neg47.2%
associate-/l*51.4%
distribute-rgt-neg-in51.4%
mul-1-neg51.4%
distribute-lft-in51.4%
mul-1-neg51.4%
unsub-neg51.4%
Simplified51.4%
Taylor expanded in x around inf 50.3%
mul-1-neg50.3%
distribute-frac-neg250.3%
Simplified50.3%
Taylor expanded in t around 0 46.0%
associate-*r/46.0%
mul-1-neg46.0%
*-commutative46.0%
distribute-rgt-neg-in46.0%
associate-*r/50.3%
Simplified50.3%
if -10 < (/.f64 x y) < 1e20Initial program 97.4%
Taylor expanded in x around 0 73.4%
if 1e20 < (/.f64 x y) Initial program 99.9%
Taylor expanded in z around 0 49.5%
*-rgt-identity49.5%
mul-1-neg49.5%
associate-/l*56.5%
distribute-rgt-neg-in56.5%
mul-1-neg56.5%
distribute-lft-in56.5%
mul-1-neg56.5%
unsub-neg56.5%
Simplified56.5%
Taylor expanded in x around inf 56.5%
mul-1-neg56.5%
distribute-frac-neg256.5%
Simplified56.5%
Final simplification64.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.3e+74) (not (<= t 7.8e-81))) (* t (- 1.0 (/ x y))) (+ t (* (/ x y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.3e+74) || !(t <= 7.8e-81)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t + ((x / 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 ((t <= (-2.3d+74)) .or. (.not. (t <= 7.8d-81))) then
tmp = t * (1.0d0 - (x / y))
else
tmp = t + ((x / y) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.3e+74) || !(t <= 7.8e-81)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t + ((x / y) * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.3e+74) or not (t <= 7.8e-81): tmp = t * (1.0 - (x / y)) else: tmp = t + ((x / y) * z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.3e+74) || !(t <= 7.8e-81)) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = Float64(t + Float64(Float64(x / y) * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.3e+74) || ~((t <= 7.8e-81))) tmp = t * (1.0 - (x / y)); else tmp = t + ((x / y) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.3e+74], N[Not[LessEqual[t, 7.8e-81]], $MachinePrecision]], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{+74} \lor \neg \left(t \leq 7.8 \cdot 10^{-81}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\end{array}
\end{array}
if t < -2.2999999999999999e74 or 7.7999999999999997e-81 < t Initial program 99.9%
Taylor expanded in z around 0 82.8%
*-rgt-identity82.8%
mul-1-neg82.8%
associate-/l*88.9%
distribute-rgt-neg-in88.9%
mul-1-neg88.9%
distribute-lft-in88.9%
mul-1-neg88.9%
unsub-neg88.9%
Simplified88.9%
if -2.2999999999999999e74 < t < 7.7999999999999997e-81Initial program 95.7%
Taylor expanded in z around inf 89.8%
Final simplification89.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.55e+54) (not (<= t 1.7e-79))) (* t (- 1.0 (/ x y))) (+ t (* x (/ z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.55e+54) || !(t <= 1.7e-79)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t + (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 <= (-1.55d+54)) .or. (.not. (t <= 1.7d-79))) then
tmp = t * (1.0d0 - (x / y))
else
tmp = t + (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 <= -1.55e+54) || !(t <= 1.7e-79)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t + (x * (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.55e+54) or not (t <= 1.7e-79): tmp = t * (1.0 - (x / y)) else: tmp = t + (x * (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.55e+54) || !(t <= 1.7e-79)) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = Float64(t + Float64(x * Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.55e+54) || ~((t <= 1.7e-79))) tmp = t * (1.0 - (x / y)); else tmp = t + (x * (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.55e+54], N[Not[LessEqual[t, 1.7e-79]], $MachinePrecision]], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{+54} \lor \neg \left(t \leq 1.7 \cdot 10^{-79}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t + x \cdot \frac{z}{y}\\
\end{array}
\end{array}
if t < -1.55e54 or 1.69999999999999988e-79 < t Initial program 99.9%
Taylor expanded in z around 0 82.8%
*-rgt-identity82.8%
mul-1-neg82.8%
associate-/l*88.6%
distribute-rgt-neg-in88.6%
mul-1-neg88.6%
distribute-lft-in88.6%
mul-1-neg88.6%
unsub-neg88.6%
Simplified88.6%
if -1.55e54 < t < 1.69999999999999988e-79Initial program 95.5%
Taylor expanded in z around inf 87.3%
associate-/l*87.7%
Simplified87.7%
Final simplification88.2%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) 0.1) t (* (/ x y) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= 0.1) {
tmp = t;
} 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 / y) <= 0.1d0) then
tmp = t
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 / y) <= 0.1) {
tmp = t;
} else {
tmp = (x / y) * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= 0.1: tmp = t else: tmp = (x / y) * t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= 0.1) tmp = t; else tmp = Float64(Float64(x / y) * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= 0.1) tmp = t; else tmp = (x / y) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], 0.1], t, N[(N[(x / y), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq 0.1:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot t\\
\end{array}
\end{array}
if (/.f64 x y) < 0.10000000000000001Initial program 97.1%
Taylor expanded in x around 0 52.3%
if 0.10000000000000001 < (/.f64 x y) Initial program 99.9%
Taylor expanded in z around 0 46.0%
*-rgt-identity46.0%
mul-1-neg46.0%
associate-/l*52.5%
distribute-rgt-neg-in52.5%
mul-1-neg52.5%
distribute-lft-in52.5%
mul-1-neg52.5%
unsub-neg52.5%
Simplified52.5%
Taylor expanded in x around inf 52.5%
mul-1-neg52.5%
distribute-frac-neg252.5%
Simplified52.5%
add-sqr-sqrt29.1%
sqrt-unprod30.2%
sqr-neg30.2%
sqrt-unprod4.2%
add-sqr-sqrt10.4%
div-inv10.4%
Applied egg-rr10.4%
associate-*r/10.4%
*-rgt-identity10.4%
Simplified10.4%
Final simplification43.1%
(FPCore (x y z t) :precision binary64 (* t (- 1.0 (/ x y))))
double code(double x, double y, double z, double t) {
return t * (1.0 - (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 = t * (1.0d0 - (x / y))
end function
public static double code(double x, double y, double z, double t) {
return t * (1.0 - (x / y));
}
def code(x, y, z, t): return t * (1.0 - (x / y))
function code(x, y, z, t) return Float64(t * Float64(1.0 - Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = t * (1.0 - (x / y)); end
code[x_, y_, z_, t_] := N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(1 - \frac{x}{y}\right)
\end{array}
Initial program 97.7%
Taylor expanded in z around 0 61.0%
*-rgt-identity61.0%
mul-1-neg61.0%
associate-/l*65.7%
distribute-rgt-neg-in65.7%
mul-1-neg65.7%
distribute-lft-in65.7%
mul-1-neg65.7%
unsub-neg65.7%
Simplified65.7%
(FPCore (x y z t) :precision binary64 t)
double code(double x, double y, double z, double t) {
return 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 = t
end function
public static double code(double x, double y, double z, double t) {
return t;
}
def code(x, y, z, t): return t
function code(x, y, z, t) return t end
function tmp = code(x, y, z, t) tmp = t; end
code[x_, y_, z_, t_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 97.7%
Taylor expanded in x around 0 41.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* (/ x y) (- z t)) t)))
(if (< z 2.759456554562692e-282)
t_1
(if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((x / y) * (z - t)) + t;
double tmp;
if (z < 2.759456554562692e-282) {
tmp = t_1;
} else if (z < 2.326994450874436e-110) {
tmp = (x * ((z - t) / y)) + t;
} 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 / y) * (z - t)) + t
if (z < 2.759456554562692d-282) then
tmp = t_1
else if (z < 2.326994450874436d-110) then
tmp = (x * ((z - t) / y)) + t
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) * (z - t)) + t;
double tmp;
if (z < 2.759456554562692e-282) {
tmp = t_1;
} else if (z < 2.326994450874436e-110) {
tmp = (x * ((z - t) / y)) + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((x / y) * (z - t)) + t tmp = 0 if z < 2.759456554562692e-282: tmp = t_1 elif z < 2.326994450874436e-110: tmp = (x * ((z - t) / y)) + t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(x / y) * Float64(z - t)) + t) tmp = 0.0 if (z < 2.759456554562692e-282) tmp = t_1; elseif (z < 2.326994450874436e-110) tmp = Float64(Float64(x * Float64(Float64(z - t) / y)) + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((x / y) * (z - t)) + t; tmp = 0.0; if (z < 2.759456554562692e-282) tmp = t_1; elseif (z < 2.326994450874436e-110) tmp = (x * ((z - t) / y)) + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, If[Less[z, 2.759456554562692e-282], t$95$1, If[Less[z, 2.326994450874436e-110], N[(N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot \left(z - t\right) + t\\
\mathbf{if}\;z < 2.759456554562692 \cdot 10^{-282}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 2.326994450874436 \cdot 10^{-110}:\\
\;\;\;\;x \cdot \frac{z - t}{y} + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024165
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
:precision binary64
:alt
(! :herbie-platform default (if (< z 689864138640673/250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (/ x y) (- z t)) t) (if (< z 581748612718609/25000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t))))
(+ (* (/ x y) (- z t)) t))