
(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 11 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 (/ (- z t) (/ y x))))
double code(double x, double y, double z, double t) {
return t + ((z - t) / (y / 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 = t + ((z - t) / (y / x))
end function
public static double code(double x, double y, double z, double t) {
return t + ((z - t) / (y / x));
}
def code(x, y, z, t): return t + ((z - t) / (y / x))
function code(x, y, z, t) return Float64(t + Float64(Float64(z - t) / Float64(y / x))) end
function tmp = code(x, y, z, t) tmp = t + ((z - t) / (y / x)); end
code[x_, y_, z_, t_] := N[(t + N[(N[(z - t), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t + \frac{z - t}{\frac{y}{x}}
\end{array}
Initial program 96.9%
*-commutative96.9%
clear-num96.9%
un-div-inv97.1%
Applied egg-rr97.1%
Final simplification97.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- 1.0 (/ x y)))))
(if (<= t -1.25e+62)
t_1
(if (<= t -3.2e-33)
(+ t (* z (/ x y)))
(if (<= t -1.05e-82)
t_1
(if (<= t -1.12e-209)
(+ t (/ (* z x) y))
(if (<= t 8.5e+51) (+ t (/ z (/ y x))) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (t <= -1.25e+62) {
tmp = t_1;
} else if (t <= -3.2e-33) {
tmp = t + (z * (x / y));
} else if (t <= -1.05e-82) {
tmp = t_1;
} else if (t <= -1.12e-209) {
tmp = t + ((z * x) / y);
} else if (t <= 8.5e+51) {
tmp = t + (z / (y / 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) :: tmp
t_1 = t * (1.0d0 - (x / y))
if (t <= (-1.25d+62)) then
tmp = t_1
else if (t <= (-3.2d-33)) then
tmp = t + (z * (x / y))
else if (t <= (-1.05d-82)) then
tmp = t_1
else if (t <= (-1.12d-209)) then
tmp = t + ((z * x) / y)
else if (t <= 8.5d+51) then
tmp = t + (z / (y / 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 = t * (1.0 - (x / y));
double tmp;
if (t <= -1.25e+62) {
tmp = t_1;
} else if (t <= -3.2e-33) {
tmp = t + (z * (x / y));
} else if (t <= -1.05e-82) {
tmp = t_1;
} else if (t <= -1.12e-209) {
tmp = t + ((z * x) / y);
} else if (t <= 8.5e+51) {
tmp = t + (z / (y / x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (1.0 - (x / y)) tmp = 0 if t <= -1.25e+62: tmp = t_1 elif t <= -3.2e-33: tmp = t + (z * (x / y)) elif t <= -1.05e-82: tmp = t_1 elif t <= -1.12e-209: tmp = t + ((z * x) / y) elif t <= 8.5e+51: tmp = t + (z / (y / x)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (t <= -1.25e+62) tmp = t_1; elseif (t <= -3.2e-33) tmp = Float64(t + Float64(z * Float64(x / y))); elseif (t <= -1.05e-82) tmp = t_1; elseif (t <= -1.12e-209) tmp = Float64(t + Float64(Float64(z * x) / y)); elseif (t <= 8.5e+51) tmp = Float64(t + Float64(z / Float64(y / x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (1.0 - (x / y)); tmp = 0.0; if (t <= -1.25e+62) tmp = t_1; elseif (t <= -3.2e-33) tmp = t + (z * (x / y)); elseif (t <= -1.05e-82) tmp = t_1; elseif (t <= -1.12e-209) tmp = t + ((z * x) / y); elseif (t <= 8.5e+51) tmp = t + (z / (y / x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.25e+62], t$95$1, If[LessEqual[t, -3.2e-33], N[(t + N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.05e-82], t$95$1, If[LessEqual[t, -1.12e-209], N[(t + N[(N[(z * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e+51], N[(t + N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;t \leq -1.25 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.2 \cdot 10^{-33}:\\
\;\;\;\;t + z \cdot \frac{x}{y}\\
\mathbf{elif}\;t \leq -1.05 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.12 \cdot 10^{-209}:\\
\;\;\;\;t + \frac{z \cdot x}{y}\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+51}:\\
\;\;\;\;t + \frac{z}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.25000000000000007e62 or -3.19999999999999977e-33 < t < -1.05e-82 or 8.4999999999999999e51 < t Initial program 100.0%
Taylor expanded in z around 0 83.0%
mul-1-neg83.0%
*-rgt-identity83.0%
associate-/l*91.9%
distribute-rgt-neg-in91.9%
mul-1-neg91.9%
distribute-lft-in92.0%
mul-1-neg92.0%
unsub-neg92.0%
Simplified92.0%
if -1.25000000000000007e62 < t < -3.19999999999999977e-33Initial program 100.0%
*-commutative100.0%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 86.5%
associate-*l/93.3%
*-commutative93.3%
Simplified93.3%
if -1.05e-82 < t < -1.12e-209Initial program 90.9%
Taylor expanded in z around inf 96.7%
if -1.12e-209 < t < 8.4999999999999999e51Initial program 95.1%
Taylor expanded in z around inf 80.8%
associate-/l*76.0%
Simplified76.0%
*-commutative76.0%
associate-/r/85.8%
Applied egg-rr85.8%
Final simplification90.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5e-15) (not (<= (/ x y) 20.0))) (* t (- (/ x y))) t))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e-15) || !((x / y) <= 20.0)) {
tmp = t * -(x / y);
} 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) <= (-5d-15)) .or. (.not. ((x / y) <= 20.0d0))) then
tmp = t * -(x / y)
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) <= -5e-15) || !((x / y) <= 20.0)) {
tmp = t * -(x / y);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -5e-15) or not ((x / y) <= 20.0): tmp = t * -(x / y) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -5e-15) || !(Float64(x / y) <= 20.0)) tmp = Float64(t * Float64(-Float64(x / y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -5e-15) || ~(((x / y) <= 20.0))) tmp = t * -(x / y); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -5e-15], N[Not[LessEqual[N[(x / y), $MachinePrecision], 20.0]], $MachinePrecision]], N[(t * (-N[(x / y), $MachinePrecision])), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-15} \lor \neg \left(\frac{x}{y} \leq 20\right):\\
\;\;\;\;t \cdot \left(-\frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if (/.f64 x y) < -4.99999999999999999e-15 or 20 < (/.f64 x y) Initial program 95.6%
Taylor expanded in z around 0 47.7%
mul-1-neg47.7%
*-rgt-identity47.7%
associate-/l*53.4%
distribute-rgt-neg-in53.4%
mul-1-neg53.4%
distribute-lft-in53.4%
mul-1-neg53.4%
unsub-neg53.4%
Simplified53.4%
Taylor expanded in x around inf 47.0%
mul-1-neg47.0%
distribute-frac-neg247.0%
*-commutative47.0%
associate-/l*50.0%
Simplified50.0%
associate-*r/47.0%
distribute-frac-neg247.0%
*-commutative47.0%
add-sqr-sqrt24.9%
sqrt-unprod28.4%
sqr-neg28.4%
sqrt-unprod2.2%
add-sqr-sqrt5.2%
associate-*l/4.5%
div-inv4.5%
associate-*l*6.7%
add-sqr-sqrt2.9%
sqrt-unprod31.6%
sqr-neg31.6%
sqrt-unprod27.1%
add-sqr-sqrt51.3%
associate-/r/51.3%
clear-num51.3%
Applied egg-rr51.3%
if -4.99999999999999999e-15 < (/.f64 x y) < 20Initial program 98.3%
Taylor expanded in x around 0 70.2%
Final simplification60.5%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -5e-15) (/ (- t) (/ y x)) (if (<= (/ x y) 20.0) t (* x (/ (- t) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e-15) {
tmp = -t / (y / x);
} else if ((x / y) <= 20.0) {
tmp = t;
} else {
tmp = x * (-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 ((x / y) <= (-5d-15)) then
tmp = -t / (y / x)
else if ((x / y) <= 20.0d0) then
tmp = t
else
tmp = x * (-t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e-15) {
tmp = -t / (y / x);
} else if ((x / y) <= 20.0) {
tmp = t;
} else {
tmp = x * (-t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e-15: tmp = -t / (y / x) elif (x / y) <= 20.0: tmp = t else: tmp = x * (-t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e-15) tmp = Float64(Float64(-t) / Float64(y / x)); elseif (Float64(x / y) <= 20.0) tmp = t; else tmp = Float64(x * Float64(Float64(-t) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -5e-15) tmp = -t / (y / x); elseif ((x / y) <= 20.0) tmp = t; else tmp = x * (-t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e-15], N[((-t) / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 20.0], t, N[(x * N[((-t) / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-15}:\\
\;\;\;\;\frac{-t}{\frac{y}{x}}\\
\mathbf{elif}\;\frac{x}{y} \leq 20:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-t}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.99999999999999999e-15Initial program 94.5%
Taylor expanded in z around 0 55.1%
mul-1-neg55.1%
*-rgt-identity55.1%
associate-/l*57.9%
distribute-rgt-neg-in57.9%
mul-1-neg57.9%
distribute-lft-in57.9%
mul-1-neg57.9%
unsub-neg57.9%
Simplified57.9%
Taylor expanded in x around inf 54.3%
mul-1-neg54.3%
distribute-frac-neg254.3%
*-commutative54.3%
associate-/l*53.5%
Simplified53.5%
*-commutative53.5%
add-sqr-sqrt24.6%
sqrt-unprod32.3%
sqr-neg32.3%
sqrt-unprod2.5%
add-sqr-sqrt4.6%
associate-/r/5.9%
frac-2neg5.9%
distribute-neg-frac5.9%
add-sqr-sqrt2.0%
sqrt-unprod31.8%
sqr-neg31.8%
sqrt-unprod30.2%
add-sqr-sqrt56.0%
Applied egg-rr56.0%
if -4.99999999999999999e-15 < (/.f64 x y) < 20Initial program 98.3%
Taylor expanded in x around 0 70.2%
if 20 < (/.f64 x y) Initial program 96.8%
Taylor expanded in z around 0 39.6%
mul-1-neg39.6%
*-rgt-identity39.6%
associate-/l*48.5%
distribute-rgt-neg-in48.5%
mul-1-neg48.5%
distribute-lft-in48.5%
mul-1-neg48.5%
unsub-neg48.5%
Simplified48.5%
Taylor expanded in x around inf 38.8%
mul-1-neg38.8%
distribute-frac-neg238.8%
*-commutative38.8%
associate-/l*46.2%
Simplified46.2%
Final simplification60.6%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -5e-15) (* t (- (/ x y))) (if (<= (/ x y) 20.0) t (* x (/ (- t) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e-15) {
tmp = t * -(x / y);
} else if ((x / y) <= 20.0) {
tmp = t;
} else {
tmp = x * (-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 ((x / y) <= (-5d-15)) then
tmp = t * -(x / y)
else if ((x / y) <= 20.0d0) then
tmp = t
else
tmp = x * (-t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e-15) {
tmp = t * -(x / y);
} else if ((x / y) <= 20.0) {
tmp = t;
} else {
tmp = x * (-t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e-15: tmp = t * -(x / y) elif (x / y) <= 20.0: tmp = t else: tmp = x * (-t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e-15) tmp = Float64(t * Float64(-Float64(x / y))); elseif (Float64(x / y) <= 20.0) tmp = t; else tmp = Float64(x * Float64(Float64(-t) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -5e-15) tmp = t * -(x / y); elseif ((x / y) <= 20.0) tmp = t; else tmp = x * (-t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e-15], N[(t * (-N[(x / y), $MachinePrecision])), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 20.0], t, N[(x * N[((-t) / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-15}:\\
\;\;\;\;t \cdot \left(-\frac{x}{y}\right)\\
\mathbf{elif}\;\frac{x}{y} \leq 20:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-t}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.99999999999999999e-15Initial program 94.5%
Taylor expanded in z around 0 55.1%
mul-1-neg55.1%
*-rgt-identity55.1%
associate-/l*57.9%
distribute-rgt-neg-in57.9%
mul-1-neg57.9%
distribute-lft-in57.9%
mul-1-neg57.9%
unsub-neg57.9%
Simplified57.9%
Taylor expanded in x around inf 54.3%
mul-1-neg54.3%
distribute-frac-neg254.3%
*-commutative54.3%
associate-/l*53.5%
Simplified53.5%
associate-*r/54.3%
distribute-frac-neg254.3%
*-commutative54.3%
add-sqr-sqrt29.7%
sqrt-unprod32.8%
sqr-neg32.8%
sqrt-unprod2.1%
add-sqr-sqrt5.9%
associate-*l/4.6%
div-inv4.6%
associate-*l*7.2%
add-sqr-sqrt2.0%
sqrt-unprod31.8%
sqr-neg31.8%
sqrt-unprod30.2%
add-sqr-sqrt56.0%
associate-/r/56.0%
clear-num56.0%
Applied egg-rr56.0%
if -4.99999999999999999e-15 < (/.f64 x y) < 20Initial program 98.3%
Taylor expanded in x around 0 70.2%
if 20 < (/.f64 x y) Initial program 96.8%
Taylor expanded in z around 0 39.6%
mul-1-neg39.6%
*-rgt-identity39.6%
associate-/l*48.5%
distribute-rgt-neg-in48.5%
mul-1-neg48.5%
distribute-lft-in48.5%
mul-1-neg48.5%
unsub-neg48.5%
Simplified48.5%
Taylor expanded in x around inf 38.8%
mul-1-neg38.8%
distribute-frac-neg238.8%
*-commutative38.8%
associate-/l*46.2%
Simplified46.2%
Final simplification60.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.3e+68) (not (<= t 8.2e+51))) (* t (- 1.0 (/ x y))) (+ t (/ z (/ y x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.3e+68) || !(t <= 8.2e+51)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t + (z / (y / 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 <= (-3.3d+68)) .or. (.not. (t <= 8.2d+51))) then
tmp = t * (1.0d0 - (x / y))
else
tmp = t + (z / (y / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.3e+68) || !(t <= 8.2e+51)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t + (z / (y / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.3e+68) or not (t <= 8.2e+51): tmp = t * (1.0 - (x / y)) else: tmp = t + (z / (y / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.3e+68) || !(t <= 8.2e+51)) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = Float64(t + Float64(z / Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.3e+68) || ~((t <= 8.2e+51))) tmp = t * (1.0 - (x / y)); else tmp = t + (z / (y / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.3e+68], N[Not[LessEqual[t, 8.2e+51]], $MachinePrecision]], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+68} \lor \neg \left(t \leq 8.2 \cdot 10^{+51}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t + \frac{z}{\frac{y}{x}}\\
\end{array}
\end{array}
if t < -3.3e68 or 8.20000000000000021e51 < t Initial program 100.0%
Taylor expanded in z around 0 81.5%
mul-1-neg81.5%
*-rgt-identity81.5%
associate-/l*91.2%
distribute-rgt-neg-in91.2%
mul-1-neg91.2%
distribute-lft-in91.2%
mul-1-neg91.2%
unsub-neg91.2%
Simplified91.2%
if -3.3e68 < t < 8.20000000000000021e51Initial program 95.4%
Taylor expanded in z around inf 83.9%
associate-/l*80.5%
Simplified80.5%
*-commutative80.5%
associate-/r/86.9%
Applied egg-rr86.9%
Final simplification88.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5.4e+66) (not (<= t 3e+52))) (* t (- 1.0 (/ x y))) (+ t (* z (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.4e+66) || !(t <= 3e+52)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t + (z * (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 ((t <= (-5.4d+66)) .or. (.not. (t <= 3d+52))) then
tmp = t * (1.0d0 - (x / y))
else
tmp = t + (z * (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.4e+66) || !(t <= 3e+52)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t + (z * (x / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5.4e+66) or not (t <= 3e+52): tmp = t * (1.0 - (x / y)) else: tmp = t + (z * (x / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -5.4e+66) || !(t <= 3e+52)) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = Float64(t + Float64(z * Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -5.4e+66) || ~((t <= 3e+52))) tmp = t * (1.0 - (x / y)); else tmp = t + (z * (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5.4e+66], N[Not[LessEqual[t, 3e+52]], $MachinePrecision]], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.4 \cdot 10^{+66} \lor \neg \left(t \leq 3 \cdot 10^{+52}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t + z \cdot \frac{x}{y}\\
\end{array}
\end{array}
if t < -5.4e66 or 3e52 < t Initial program 100.0%
Taylor expanded in z around 0 81.5%
mul-1-neg81.5%
*-rgt-identity81.5%
associate-/l*91.2%
distribute-rgt-neg-in91.2%
mul-1-neg91.2%
distribute-lft-in91.2%
mul-1-neg91.2%
unsub-neg91.2%
Simplified91.2%
if -5.4e66 < t < 3e52Initial program 95.4%
*-commutative95.4%
clear-num95.3%
un-div-inv95.6%
Applied egg-rr95.6%
Taylor expanded in z around inf 83.9%
associate-*l/86.7%
*-commutative86.7%
Simplified86.7%
Final simplification88.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5e+64) (not (<= t 4.6e+52))) (* t (- 1.0 (/ x y))) (+ t (* x (/ z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5e+64) || !(t <= 4.6e+52)) {
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 <= (-5d+64)) .or. (.not. (t <= 4.6d+52))) 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 <= -5e+64) || !(t <= 4.6e+52)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t + (x * (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5e+64) or not (t <= 4.6e+52): 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 <= -5e+64) || !(t <= 4.6e+52)) 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 <= -5e+64) || ~((t <= 4.6e+52))) 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, -5e+64], N[Not[LessEqual[t, 4.6e+52]], $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 -5 \cdot 10^{+64} \lor \neg \left(t \leq 4.6 \cdot 10^{+52}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t + x \cdot \frac{z}{y}\\
\end{array}
\end{array}
if t < -5e64 or 4.6e52 < t Initial program 100.0%
Taylor expanded in z around 0 81.5%
mul-1-neg81.5%
*-rgt-identity81.5%
associate-/l*91.2%
distribute-rgt-neg-in91.2%
mul-1-neg91.2%
distribute-lft-in91.2%
mul-1-neg91.2%
unsub-neg91.2%
Simplified91.2%
if -5e64 < t < 4.6e52Initial program 95.4%
Taylor expanded in z around inf 83.9%
associate-/l*80.5%
Simplified80.5%
Final simplification84.2%
(FPCore (x y z t) :precision binary64 (+ t (* (- z t) (/ x y))))
double code(double x, double y, double z, double t) {
return t + ((z - t) * (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 + ((z - t) * (x / y))
end function
public static double code(double x, double y, double z, double t) {
return t + ((z - t) * (x / y));
}
def code(x, y, z, t): return t + ((z - t) * (x / y))
function code(x, y, z, t) return Float64(t + Float64(Float64(z - t) * Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = t + ((z - t) * (x / y)); end
code[x_, y_, z_, t_] := N[(t + N[(N[(z - t), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t + \left(z - t\right) \cdot \frac{x}{y}
\end{array}
Initial program 96.9%
Final simplification96.9%
(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 96.9%
Taylor expanded in z around 0 57.2%
mul-1-neg57.2%
*-rgt-identity57.2%
associate-/l*61.6%
distribute-rgt-neg-in61.6%
mul-1-neg61.6%
distribute-lft-in61.6%
mul-1-neg61.6%
unsub-neg61.6%
Simplified61.6%
(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 96.9%
Taylor expanded in x around 0 35.8%
(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 2024096
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
:precision binary64
:alt
(if (< z 2.759456554562692e-282) (+ (* (/ x y) (- z t)) t) (if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t)))
(+ (* (/ x y) (- z t)) t))