
(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 98.4%
Final simplification98.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+14) (not (<= (/ x y) 5.0))) (* (/ x y) (- t)) t))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+14) || !((x / y) <= 5.0)) {
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) <= (-1d+14)) .or. (.not. ((x / y) <= 5.0d0))) 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) <= -1e+14) || !((x / y) <= 5.0)) {
tmp = (x / y) * -t;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1e+14) or not ((x / y) <= 5.0): tmp = (x / y) * -t else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1e+14) || !(Float64(x / y) <= 5.0)) 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) <= -1e+14) || ~(((x / y) <= 5.0))) tmp = (x / y) * -t; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1e+14], N[Not[LessEqual[N[(x / y), $MachinePrecision], 5.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] * (-t)), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+14} \lor \neg \left(\frac{x}{y} \leq 5\right):\\
\;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if (/.f64 x y) < -1e14 or 5 < (/.f64 x y) Initial program 98.4%
Taylor expanded in z around 0 52.6%
*-rgt-identity52.6%
mul-1-neg52.6%
associate-/l*56.3%
distribute-rgt-neg-in56.3%
mul-1-neg56.3%
distribute-lft-in56.2%
mul-1-neg56.2%
unsub-neg56.2%
Simplified56.2%
Taylor expanded in x around inf 52.6%
mul-1-neg52.6%
distribute-frac-neg52.6%
distribute-rgt-neg-in52.6%
associate-*r/56.1%
Simplified56.1%
if -1e14 < (/.f64 x y) < 5Initial program 98.5%
Taylor expanded in x around 0 77.3%
Final simplification67.4%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -5e-99) (* y (/ t y)) (if (<= (/ x y) 2e+71) t (* (/ x y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e-99) {
tmp = y * (t / y);
} else if ((x / y) <= 2e+71) {
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) <= (-5d-99)) then
tmp = y * (t / y)
else if ((x / y) <= 2d+71) 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) <= -5e-99) {
tmp = y * (t / y);
} else if ((x / y) <= 2e+71) {
tmp = t;
} else {
tmp = (x / y) * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e-99: tmp = y * (t / y) elif (x / y) <= 2e+71: tmp = t else: tmp = (x / y) * t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e-99) tmp = Float64(y * Float64(t / y)); elseif (Float64(x / y) <= 2e+71) 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) <= -5e-99) tmp = y * (t / y); elseif ((x / y) <= 2e+71) tmp = t; else tmp = (x / y) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e-99], N[(y * N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e+71], t, N[(N[(x / y), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-99}:\\
\;\;\;\;y \cdot \frac{t}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+71}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot t\\
\end{array}
\end{array}
if (/.f64 x y) < -4.99999999999999969e-99Initial program 97.5%
Taylor expanded in z around 0 61.5%
neg-mul-161.5%
Simplified61.5%
Taylor expanded in y around 0 52.4%
mul-1-neg52.4%
distribute-rgt-neg-out52.4%
+-commutative52.4%
distribute-lft-out52.4%
Simplified52.4%
Taylor expanded in y around inf 11.9%
*-commutative11.9%
associate-/l*20.2%
Applied egg-rr20.2%
if -4.99999999999999969e-99 < (/.f64 x y) < 2.0000000000000001e71Initial program 98.4%
Taylor expanded in x around 0 76.6%
if 2.0000000000000001e71 < (/.f64 x y) Initial program 99.8%
Taylor expanded in z around 0 47.3%
neg-mul-147.3%
Simplified47.3%
Taylor expanded in y around 0 45.4%
mul-1-neg45.4%
distribute-rgt-neg-out45.4%
+-commutative45.4%
distribute-lft-out47.3%
Simplified47.3%
Taylor expanded in y around 0 47.3%
mul-1-neg47.3%
distribute-lft-neg-out47.3%
*-commutative47.3%
Simplified47.3%
distribute-rgt-neg-out47.3%
distribute-lft-neg-in47.3%
associate-*l/47.3%
div-inv47.3%
associate-*l*45.5%
add-sqr-sqrt27.8%
sqrt-unprod30.2%
sqr-neg30.2%
sqrt-unprod2.5%
add-sqr-sqrt8.9%
associate-*l*12.6%
div-inv12.6%
Applied egg-rr12.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.7e+58) (not (<= z 6.5e-70))) (+ t (* (/ x y) z)) (- t (* (/ x y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.7e+58) || !(z <= 6.5e-70)) {
tmp = t + ((x / y) * z);
} else {
tmp = t - ((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 <= (-2.7d+58)) .or. (.not. (z <= 6.5d-70))) then
tmp = t + ((x / y) * z)
else
tmp = t - ((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 <= -2.7e+58) || !(z <= 6.5e-70)) {
tmp = t + ((x / y) * z);
} else {
tmp = t - ((x / y) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.7e+58) or not (z <= 6.5e-70): tmp = t + ((x / y) * z) else: tmp = t - ((x / y) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.7e+58) || !(z <= 6.5e-70)) tmp = Float64(t + Float64(Float64(x / y) * z)); else tmp = Float64(t - Float64(Float64(x / y) * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.7e+58) || ~((z <= 6.5e-70))) tmp = t + ((x / y) * z); else tmp = t - ((x / y) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.7e+58], N[Not[LessEqual[z, 6.5e-70]], $MachinePrecision]], N[(t + N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(t - N[(N[(x / y), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+58} \lor \neg \left(z \leq 6.5 \cdot 10^{-70}\right):\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t - \frac{x}{y} \cdot t\\
\end{array}
\end{array}
if z < -2.7000000000000001e58 or 6.5000000000000005e-70 < z Initial program 98.5%
Taylor expanded in z around inf 93.2%
if -2.7000000000000001e58 < z < 6.5000000000000005e-70Initial program 98.4%
Taylor expanded in z around 0 87.4%
*-rgt-identity87.4%
mul-1-neg87.4%
associate-/l*90.4%
distribute-rgt-neg-in90.4%
mul-1-neg90.4%
distribute-lft-in90.4%
mul-1-neg90.4%
unsub-neg90.4%
Simplified90.4%
sub-neg90.4%
distribute-lft-in90.4%
*-commutative90.4%
distribute-neg-frac90.4%
add-sqr-sqrt46.8%
sqrt-unprod67.1%
sqr-neg67.1%
sqrt-unprod28.2%
add-sqr-sqrt51.7%
clear-num51.7%
associate-/r/51.7%
associate-*l*49.2%
div-inv49.2%
*-commutative49.2%
add-sqr-sqrt26.5%
sqrt-unprod65.3%
sqr-neg65.3%
sqrt-unprod46.8%
add-sqr-sqrt87.1%
*-un-lft-identity87.1%
cancel-sign-sub-inv87.1%
*-commutative87.1%
Applied egg-rr90.4%
Final simplification91.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.5e+58) (not (<= z 7.6e-70))) (+ t (* (/ x y) z)) (* t (- 1.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.5e+58) || !(z <= 7.6e-70)) {
tmp = t + ((x / y) * z);
} else {
tmp = t * (1.0 - (x / 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 ((z <= (-2.5d+58)) .or. (.not. (z <= 7.6d-70))) then
tmp = t + ((x / y) * z)
else
tmp = t * (1.0d0 - (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.5e+58) || !(z <= 7.6e-70)) {
tmp = t + ((x / y) * z);
} else {
tmp = t * (1.0 - (x / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.5e+58) or not (z <= 7.6e-70): tmp = t + ((x / y) * z) else: tmp = t * (1.0 - (x / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.5e+58) || !(z <= 7.6e-70)) tmp = Float64(t + Float64(Float64(x / y) * z)); else tmp = Float64(t * Float64(1.0 - Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.5e+58) || ~((z <= 7.6e-70))) tmp = t + ((x / y) * z); else tmp = t * (1.0 - (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.5e+58], N[Not[LessEqual[z, 7.6e-70]], $MachinePrecision]], N[(t + N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+58} \lor \neg \left(z \leq 7.6 \cdot 10^{-70}\right):\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
if z < -2.49999999999999993e58 or 7.5999999999999995e-70 < z Initial program 98.5%
Taylor expanded in z around inf 93.2%
if -2.49999999999999993e58 < z < 7.5999999999999995e-70Initial program 98.4%
Taylor expanded in z around 0 87.4%
*-rgt-identity87.4%
mul-1-neg87.4%
associate-/l*90.4%
distribute-rgt-neg-in90.4%
mul-1-neg90.4%
distribute-lft-in90.4%
mul-1-neg90.4%
unsub-neg90.4%
Simplified90.4%
Final simplification91.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.5e+58) (not (<= z 1.1e-41))) (+ t (* x (/ z y))) (* t (- 1.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.5e+58) || !(z <= 1.1e-41)) {
tmp = t + (x * (z / y));
} else {
tmp = t * (1.0 - (x / 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 ((z <= (-2.5d+58)) .or. (.not. (z <= 1.1d-41))) then
tmp = t + (x * (z / y))
else
tmp = t * (1.0d0 - (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.5e+58) || !(z <= 1.1e-41)) {
tmp = t + (x * (z / y));
} else {
tmp = t * (1.0 - (x / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.5e+58) or not (z <= 1.1e-41): tmp = t + (x * (z / y)) else: tmp = t * (1.0 - (x / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.5e+58) || !(z <= 1.1e-41)) tmp = Float64(t + Float64(x * Float64(z / y))); else tmp = Float64(t * Float64(1.0 - Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.5e+58) || ~((z <= 1.1e-41))) tmp = t + (x * (z / y)); else tmp = t * (1.0 - (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.5e+58], N[Not[LessEqual[z, 1.1e-41]], $MachinePrecision]], N[(t + N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+58} \lor \neg \left(z \leq 1.1 \cdot 10^{-41}\right):\\
\;\;\;\;t + x \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
if z < -2.49999999999999993e58 or 1.1e-41 < z Initial program 98.4%
Taylor expanded in z around inf 90.8%
associate-/l*91.5%
Simplified91.5%
if -2.49999999999999993e58 < z < 1.1e-41Initial program 98.5%
Taylor expanded in z around 0 87.2%
*-rgt-identity87.2%
mul-1-neg87.2%
associate-/l*90.1%
distribute-rgt-neg-in90.1%
mul-1-neg90.1%
distribute-lft-in90.0%
mul-1-neg90.0%
unsub-neg90.0%
Simplified90.0%
Final simplification90.8%
(FPCore (x y z t) :precision binary64 (if (<= t -1e+213) (* t (- 1.0 (/ x y))) (+ t (* x (/ (- z t) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1e+213) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t + (x * ((z - t) / 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 <= (-1d+213)) then
tmp = t * (1.0d0 - (x / y))
else
tmp = t + (x * ((z - t) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1e+213) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t + (x * ((z - t) / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1e+213: tmp = t * (1.0 - (x / y)) else: tmp = t + (x * ((z - t) / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1e+213) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = Float64(t + Float64(x * Float64(Float64(z - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1e+213) tmp = t * (1.0 - (x / y)); else tmp = t + (x * ((z - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1e+213], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+213}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t + x \cdot \frac{z - t}{y}\\
\end{array}
\end{array}
if t < -9.99999999999999984e212Initial program 100.0%
Taylor expanded in z around 0 100.0%
*-rgt-identity100.0%
mul-1-neg100.0%
associate-/l*100.0%
distribute-rgt-neg-in100.0%
mul-1-neg100.0%
distribute-lft-in100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
if -9.99999999999999984e212 < t Initial program 98.3%
Taylor expanded in x around 0 94.3%
associate-*r/96.3%
Simplified96.3%
Final simplification96.6%
(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 98.4%
Taylor expanded in z around 0 65.2%
*-rgt-identity65.2%
mul-1-neg65.2%
associate-/l*68.4%
distribute-rgt-neg-in68.4%
mul-1-neg68.4%
distribute-lft-in68.4%
mul-1-neg68.4%
unsub-neg68.4%
Simplified68.4%
(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 98.4%
Taylor expanded in x around 0 42.4%
(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 2024157
(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))