
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 85.4%
associate-/l*98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ z (/ (- a t) y)))) (t_2 (- x (* y (+ (/ z t) -1.0)))))
(if (<= t -9.2e+32)
t_2
(if (<= t 3.2e-128)
t_1
(if (<= t 9e-97)
(+ x (* y (/ t (- t a))))
(if (<= t 1e+24) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z / ((a - t) / y));
double t_2 = x - (y * ((z / t) + -1.0));
double tmp;
if (t <= -9.2e+32) {
tmp = t_2;
} else if (t <= 3.2e-128) {
tmp = t_1;
} else if (t <= 9e-97) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 1e+24) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (z / ((a - t) / y))
t_2 = x - (y * ((z / t) + (-1.0d0)))
if (t <= (-9.2d+32)) then
tmp = t_2
else if (t <= 3.2d-128) then
tmp = t_1
else if (t <= 9d-97) then
tmp = x + (y * (t / (t - a)))
else if (t <= 1d+24) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z / ((a - t) / y));
double t_2 = x - (y * ((z / t) + -1.0));
double tmp;
if (t <= -9.2e+32) {
tmp = t_2;
} else if (t <= 3.2e-128) {
tmp = t_1;
} else if (t <= 9e-97) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 1e+24) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z / ((a - t) / y)) t_2 = x - (y * ((z / t) + -1.0)) tmp = 0 if t <= -9.2e+32: tmp = t_2 elif t <= 3.2e-128: tmp = t_1 elif t <= 9e-97: tmp = x + (y * (t / (t - a))) elif t <= 1e+24: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z / Float64(Float64(a - t) / y))) t_2 = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))) tmp = 0.0 if (t <= -9.2e+32) tmp = t_2; elseif (t <= 3.2e-128) tmp = t_1; elseif (t <= 9e-97) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); elseif (t <= 1e+24) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z / ((a - t) / y)); t_2 = x - (y * ((z / t) + -1.0)); tmp = 0.0; if (t <= -9.2e+32) tmp = t_2; elseif (t <= 3.2e-128) tmp = t_1; elseif (t <= 9e-97) tmp = x + (y * (t / (t - a))); elseif (t <= 1e+24) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.2e+32], t$95$2, If[LessEqual[t, 3.2e-128], t$95$1, If[LessEqual[t, 9e-97], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e+24], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{\frac{a - t}{y}}\\
t_2 := x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{if}\;t \leq -9.2 \cdot 10^{+32}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-128}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-97}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{elif}\;t \leq 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -9.1999999999999998e32 or 9.9999999999999998e23 < t Initial program 74.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 70.0%
mul-1-neg70.0%
unsub-neg70.0%
associate-/l*92.8%
div-sub92.8%
sub-neg92.8%
*-inverses92.8%
metadata-eval92.8%
Simplified92.8%
if -9.1999999999999998e32 < t < 3.1999999999999998e-128 or 9.0000000000000002e-97 < t < 9.9999999999999998e23Initial program 92.9%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in z around inf 86.6%
*-commutative86.6%
associate-/l*92.8%
Applied egg-rr92.8%
clear-num92.8%
un-div-inv92.9%
Applied egg-rr92.9%
if 3.1999999999999998e-128 < t < 9.0000000000000002e-97Initial program 99.7%
associate-/l*91.4%
Simplified91.4%
Taylor expanded in z around 0 91.0%
mul-1-neg91.0%
unsub-neg91.0%
associate-/l*82.7%
Simplified82.7%
Taylor expanded in y around 0 91.0%
*-commutative91.0%
associate-/l*91.1%
Applied egg-rr91.1%
Final simplification92.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.6e+128) (not (<= t 1e+24))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.6e+128) || !(t <= 1e+24)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.6d+128)) .or. (.not. (t <= 1d+24))) then
tmp = x + y
else
tmp = x + (z * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.6e+128) || !(t <= 1e+24)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.6e+128) or not (t <= 1e+24): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.6e+128) || !(t <= 1e+24)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.6e+128) || ~((t <= 1e+24))) tmp = x + y; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.6e+128], N[Not[LessEqual[t, 1e+24]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+128} \lor \neg \left(t \leq 10^{+24}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -2.6e128 or 9.9999999999999998e23 < t Initial program 71.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 86.3%
+-commutative86.3%
Simplified86.3%
if -2.6e128 < t < 9.9999999999999998e23Initial program 92.9%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in z around inf 83.0%
*-commutative83.0%
associate-/l*88.3%
Applied egg-rr88.3%
Final simplification87.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.4e+128) (not (<= t 7.8e+23))) (+ x y) (+ x (/ z (/ (- a t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.4e+128) || !(t <= 7.8e+23)) {
tmp = x + y;
} else {
tmp = x + (z / ((a - t) / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-6.4d+128)) .or. (.not. (t <= 7.8d+23))) then
tmp = x + y
else
tmp = x + (z / ((a - t) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.4e+128) || !(t <= 7.8e+23)) {
tmp = x + y;
} else {
tmp = x + (z / ((a - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.4e+128) or not (t <= 7.8e+23): tmp = x + y else: tmp = x + (z / ((a - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.4e+128) || !(t <= 7.8e+23)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6.4e+128) || ~((t <= 7.8e+23))) tmp = x + y; else tmp = x + (z / ((a - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.4e+128], N[Not[LessEqual[t, 7.8e+23]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.4 \cdot 10^{+128} \lor \neg \left(t \leq 7.8 \cdot 10^{+23}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if t < -6.39999999999999971e128 or 7.8000000000000001e23 < t Initial program 71.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 86.3%
+-commutative86.3%
Simplified86.3%
if -6.39999999999999971e128 < t < 7.8000000000000001e23Initial program 92.9%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in z around inf 83.0%
*-commutative83.0%
associate-/l*88.3%
Applied egg-rr88.3%
clear-num88.2%
un-div-inv88.3%
Applied egg-rr88.3%
Final simplification87.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.6e+31) (not (<= t 5.9e+23))) (- x (* y (+ (/ z t) -1.0))) (+ x (/ z (/ (- a t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.6e+31) || !(t <= 5.9e+23)) {
tmp = x - (y * ((z / t) + -1.0));
} else {
tmp = x + (z / ((a - t) / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.6d+31)) .or. (.not. (t <= 5.9d+23))) then
tmp = x - (y * ((z / t) + (-1.0d0)))
else
tmp = x + (z / ((a - t) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.6e+31) || !(t <= 5.9e+23)) {
tmp = x - (y * ((z / t) + -1.0));
} else {
tmp = x + (z / ((a - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.6e+31) or not (t <= 5.9e+23): tmp = x - (y * ((z / t) + -1.0)) else: tmp = x + (z / ((a - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.6e+31) || !(t <= 5.9e+23)) tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); else tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.6e+31) || ~((t <= 5.9e+23))) tmp = x - (y * ((z / t) + -1.0)); else tmp = x + (z / ((a - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.6e+31], N[Not[LessEqual[t, 5.9e+23]], $MachinePrecision]], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{+31} \lor \neg \left(t \leq 5.9 \cdot 10^{+23}\right):\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if t < -1.6e31 or 5.89999999999999987e23 < t Initial program 74.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 70.0%
mul-1-neg70.0%
unsub-neg70.0%
associate-/l*92.8%
div-sub92.8%
sub-neg92.8%
*-inverses92.8%
metadata-eval92.8%
Simplified92.8%
if -1.6e31 < t < 5.89999999999999987e23Initial program 93.4%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in z around inf 83.7%
*-commutative83.7%
associate-/l*89.5%
Applied egg-rr89.5%
clear-num89.5%
un-div-inv89.6%
Applied egg-rr89.6%
Final simplification91.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.05e+34) (+ x (* t (/ y (- t a)))) (if (<= t 1e+24) (+ x (/ z (/ (- a t) y))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.05e+34) {
tmp = x + (t * (y / (t - a)));
} else if (t <= 1e+24) {
tmp = x + (z / ((a - t) / y));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-3.05d+34)) then
tmp = x + (t * (y / (t - a)))
else if (t <= 1d+24) then
tmp = x + (z / ((a - t) / y))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.05e+34) {
tmp = x + (t * (y / (t - a)));
} else if (t <= 1e+24) {
tmp = x + (z / ((a - t) / y));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.05e+34: tmp = x + (t * (y / (t - a))) elif t <= 1e+24: tmp = x + (z / ((a - t) / y)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.05e+34) tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); elseif (t <= 1e+24) tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.05e+34) tmp = x + (t * (y / (t - a))); elseif (t <= 1e+24) tmp = x + (z / ((a - t) / y)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.05e+34], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e+24], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.05 \cdot 10^{+34}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\mathbf{elif}\;t \leq 10^{+24}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.04999999999999998e34Initial program 63.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 55.7%
mul-1-neg55.7%
unsub-neg55.7%
associate-/l*87.4%
Simplified87.4%
if -3.04999999999999998e34 < t < 9.9999999999999998e23Initial program 93.4%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in z around inf 83.8%
*-commutative83.8%
associate-/l*89.6%
Applied egg-rr89.6%
clear-num89.5%
un-div-inv89.7%
Applied egg-rr89.7%
if 9.9999999999999998e23 < t Initial program 85.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 85.8%
+-commutative85.8%
Simplified85.8%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -0.48) (not (<= t 4.8e+23))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -0.48) || !(t <= 4.8e+23)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-0.48d0)) .or. (.not. (t <= 4.8d+23))) then
tmp = x + y
else
tmp = x + ((y * z) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -0.48) || !(t <= 4.8e+23)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -0.48) or not (t <= 4.8e+23): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -0.48) || !(t <= 4.8e+23)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -0.48) || ~((t <= 4.8e+23))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -0.48], N[Not[LessEqual[t, 4.8e+23]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.48 \lor \neg \left(t \leq 4.8 \cdot 10^{+23}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -0.47999999999999998 or 4.8e23 < t Initial program 73.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 82.1%
+-commutative82.1%
Simplified82.1%
if -0.47999999999999998 < t < 4.8e23Initial program 95.1%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in t around 0 73.7%
Final simplification77.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -650000.0) (not (<= t 6.6e+23))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -650000.0) || !(t <= 6.6e+23)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-650000.0d0)) .or. (.not. (t <= 6.6d+23))) then
tmp = x + y
else
tmp = x + (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -650000.0) || !(t <= 6.6e+23)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -650000.0) or not (t <= 6.6e+23): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -650000.0) || !(t <= 6.6e+23)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -650000.0) || ~((t <= 6.6e+23))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -650000.0], N[Not[LessEqual[t, 6.6e+23]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -650000 \lor \neg \left(t \leq 6.6 \cdot 10^{+23}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -6.5e5 or 6.60000000000000059e23 < t Initial program 74.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 82.8%
+-commutative82.8%
Simplified82.8%
if -6.5e5 < t < 6.60000000000000059e23Initial program 94.5%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in t around 0 72.8%
+-commutative72.8%
associate-/l*76.2%
Simplified76.2%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -62000.0) (not (<= t 5.9e+23))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -62000.0) || !(t <= 5.9e+23)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-62000.0d0)) .or. (.not. (t <= 5.9d+23))) then
tmp = x + y
else
tmp = x + (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -62000.0) || !(t <= 5.9e+23)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -62000.0) or not (t <= 5.9e+23): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -62000.0) || !(t <= 5.9e+23)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -62000.0) || ~((t <= 5.9e+23))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -62000.0], N[Not[LessEqual[t, 5.9e+23]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -62000 \lor \neg \left(t \leq 5.9 \cdot 10^{+23}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -62000 or 5.89999999999999987e23 < t Initial program 74.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 82.8%
+-commutative82.8%
Simplified82.8%
if -62000 < t < 5.89999999999999987e23Initial program 94.5%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in t around 0 72.8%
+-commutative72.8%
associate-/l*76.2%
Simplified76.2%
clear-num76.1%
un-div-inv76.2%
Applied egg-rr76.2%
associate-/r/77.4%
Simplified77.4%
Final simplification79.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -230.0) (not (<= t 6.6e+23))) (+ x y) (+ x (/ z (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -230.0) || !(t <= 6.6e+23)) {
tmp = x + y;
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-230.0d0)) .or. (.not. (t <= 6.6d+23))) then
tmp = x + y
else
tmp = x + (z / (a / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -230.0) || !(t <= 6.6e+23)) {
tmp = x + y;
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -230.0) or not (t <= 6.6e+23): tmp = x + y else: tmp = x + (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -230.0) || !(t <= 6.6e+23)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -230.0) || ~((t <= 6.6e+23))) tmp = x + y; else tmp = x + (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -230.0], N[Not[LessEqual[t, 6.6e+23]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -230 \lor \neg \left(t \leq 6.6 \cdot 10^{+23}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -230 or 6.60000000000000059e23 < t Initial program 74.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 82.8%
+-commutative82.8%
Simplified82.8%
if -230 < t < 6.60000000000000059e23Initial program 94.5%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in t around 0 72.8%
+-commutative72.8%
associate-/l*76.2%
Simplified76.2%
clear-num76.1%
un-div-inv76.2%
Applied egg-rr76.2%
associate-/r/77.4%
Simplified77.4%
*-commutative77.4%
clear-num77.4%
un-div-inv77.5%
Applied egg-rr77.5%
Final simplification79.9%
(FPCore (x y z t a) :precision binary64 (if (<= a 9.5e+56) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 9.5e+56) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= 9.5d+56) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 9.5e+56) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 9.5e+56: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 9.5e+56) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 9.5e+56) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 9.5e+56], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 9.5 \cdot 10^{+56}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 9.4999999999999997e56Initial program 86.7%
associate-/l*98.1%
Simplified98.1%
Taylor expanded in t around inf 59.1%
+-commutative59.1%
Simplified59.1%
if 9.4999999999999997e56 < a Initial program 79.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 69.4%
Final simplification61.0%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 85.4%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in x around inf 49.5%
Final simplification49.5%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2024115
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))