
(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}
Sampling outcomes in binary64 precision:
Herbie found 11 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(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}
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- t a) (- t z)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((t - a) / (t - z)));
}
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 / ((t - a) / (t - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((t - a) / (t - z)));
}
def code(x, y, z, t, a): return x + (y / ((t - a) / (t - z)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(t - a) / Float64(t - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((t - a) / (t - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{t - a}{t - z}}
\end{array}
Initial program 98.4%
clear-num98.4%
un-div-inv98.8%
Applied egg-rr98.8%
Final simplification98.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) (- a t)))))
(if (<= t -0.92)
(+ x y)
(if (<= t 1.5e-129)
t_1
(if (<= t 9e-97)
(+ x (/ (* y t) (- t a)))
(if (<= t 9.6e+23) t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y * z) / (a - t));
double tmp;
if (t <= -0.92) {
tmp = x + y;
} else if (t <= 1.5e-129) {
tmp = t_1;
} else if (t <= 9e-97) {
tmp = x + ((y * t) / (t - a));
} else if (t <= 9.6e+23) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + ((y * z) / (a - t))
if (t <= (-0.92d0)) then
tmp = x + y
else if (t <= 1.5d-129) then
tmp = t_1
else if (t <= 9d-97) then
tmp = x + ((y * t) / (t - a))
else if (t <= 9.6d+23) then
tmp = t_1
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 t_1 = x + ((y * z) / (a - t));
double tmp;
if (t <= -0.92) {
tmp = x + y;
} else if (t <= 1.5e-129) {
tmp = t_1;
} else if (t <= 9e-97) {
tmp = x + ((y * t) / (t - a));
} else if (t <= 9.6e+23) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y * z) / (a - t)) tmp = 0 if t <= -0.92: tmp = x + y elif t <= 1.5e-129: tmp = t_1 elif t <= 9e-97: tmp = x + ((y * t) / (t - a)) elif t <= 9.6e+23: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y * z) / Float64(a - t))) tmp = 0.0 if (t <= -0.92) tmp = Float64(x + y); elseif (t <= 1.5e-129) tmp = t_1; elseif (t <= 9e-97) tmp = Float64(x + Float64(Float64(y * t) / Float64(t - a))); elseif (t <= 9.6e+23) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y * z) / (a - t)); tmp = 0.0; if (t <= -0.92) tmp = x + y; elseif (t <= 1.5e-129) tmp = t_1; elseif (t <= 9e-97) tmp = x + ((y * t) / (t - a)); elseif (t <= 9.6e+23) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -0.92], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.5e-129], t$95$1, If[LessEqual[t, 9e-97], N[(x + N[(N[(y * t), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.6e+23], t$95$1, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{a - t}\\
\mathbf{if}\;t \leq -0.92:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-97}:\\
\;\;\;\;x + \frac{y \cdot t}{t - a}\\
\mathbf{elif}\;t \leq 9.6 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -0.92000000000000004 or 9.6e23 < t Initial program 99.9%
Taylor expanded in t around inf 82.1%
+-commutative82.1%
Simplified82.1%
if -0.92000000000000004 < t < 1.4999999999999999e-129 or 9.0000000000000002e-97 < t < 9.6e23Initial program 97.7%
Taylor expanded in z around inf 89.5%
if 1.4999999999999999e-129 < t < 9.0000000000000002e-97Initial program 91.4%
Taylor expanded in z around 0 91.0%
+-commutative91.0%
associate-*r/91.0%
mul-1-neg91.0%
distribute-lft-neg-out91.0%
*-commutative91.0%
Simplified91.0%
frac-2neg91.0%
div-inv91.0%
distribute-rgt-neg-out91.0%
remove-double-neg91.0%
*-commutative91.0%
sub-neg91.0%
distribute-neg-in91.0%
add-sqr-sqrt0.0%
sqrt-unprod59.3%
sqr-neg59.3%
sqrt-unprod59.3%
add-sqr-sqrt59.3%
add-sqr-sqrt0.0%
sqrt-unprod91.0%
sqr-neg91.0%
sqrt-unprod91.0%
add-sqr-sqrt91.0%
Applied egg-rr91.0%
associate-*r/91.0%
*-rgt-identity91.0%
+-commutative91.0%
unsub-neg91.0%
Simplified91.0%
Final simplification86.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) (- a t)))) (t_2 (- x (* y (+ (/ z t) -1.0)))))
(if (<= t -0.05)
t_2
(if (<= t 3.2e-128)
t_1
(if (<= t 9e-97)
(+ x (/ (* y t) (- t a)))
(if (<= t 9e+23) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y * z) / (a - t));
double t_2 = x - (y * ((z / t) + -1.0));
double tmp;
if (t <= -0.05) {
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 <= 9e+23) {
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 + ((y * z) / (a - t))
t_2 = x - (y * ((z / t) + (-1.0d0)))
if (t <= (-0.05d0)) 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 <= 9d+23) 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 + ((y * z) / (a - t));
double t_2 = x - (y * ((z / t) + -1.0));
double tmp;
if (t <= -0.05) {
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 <= 9e+23) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y * z) / (a - t)) t_2 = x - (y * ((z / t) + -1.0)) tmp = 0 if t <= -0.05: tmp = t_2 elif t <= 3.2e-128: tmp = t_1 elif t <= 9e-97: tmp = x + ((y * t) / (t - a)) elif t <= 9e+23: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y * z) / Float64(a - t))) t_2 = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))) tmp = 0.0 if (t <= -0.05) tmp = t_2; elseif (t <= 3.2e-128) tmp = t_1; elseif (t <= 9e-97) tmp = Float64(x + Float64(Float64(y * t) / Float64(t - a))); elseif (t <= 9e+23) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y * z) / (a - t)); t_2 = x - (y * ((z / t) + -1.0)); tmp = 0.0; if (t <= -0.05) tmp = t_2; elseif (t <= 3.2e-128) tmp = t_1; elseif (t <= 9e-97) tmp = x + ((y * t) / (t - a)); elseif (t <= 9e+23) 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[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -0.05], t$95$2, If[LessEqual[t, 3.2e-128], t$95$1, If[LessEqual[t, 9e-97], N[(x + N[(N[(y * t), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e+23], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{a - t}\\
t_2 := x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{if}\;t \leq -0.05:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-128}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-97}:\\
\;\;\;\;x + \frac{y \cdot t}{t - a}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -0.050000000000000003 or 8.99999999999999958e23 < t Initial program 99.9%
Taylor expanded in a around 0 68.8%
mul-1-neg68.8%
unsub-neg68.8%
associate-/l*90.0%
div-sub90.0%
sub-neg90.0%
*-inverses90.0%
metadata-eval90.0%
Simplified90.0%
if -0.050000000000000003 < t < 3.1999999999999998e-128 or 9.0000000000000002e-97 < t < 8.99999999999999958e23Initial program 97.7%
Taylor expanded in z around inf 89.5%
if 3.1999999999999998e-128 < t < 9.0000000000000002e-97Initial program 91.4%
Taylor expanded in z around 0 91.0%
+-commutative91.0%
associate-*r/91.0%
mul-1-neg91.0%
distribute-lft-neg-out91.0%
*-commutative91.0%
Simplified91.0%
frac-2neg91.0%
div-inv91.0%
distribute-rgt-neg-out91.0%
remove-double-neg91.0%
*-commutative91.0%
sub-neg91.0%
distribute-neg-in91.0%
add-sqr-sqrt0.0%
sqrt-unprod59.3%
sqr-neg59.3%
sqrt-unprod59.3%
add-sqr-sqrt59.3%
add-sqr-sqrt0.0%
sqrt-unprod91.0%
sqr-neg91.0%
sqrt-unprod91.0%
add-sqr-sqrt91.0%
Applied egg-rr91.0%
associate-*r/91.0%
*-rgt-identity91.0%
+-commutative91.0%
unsub-neg91.0%
Simplified91.0%
Final simplification89.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) (- a t)))) (t_2 (+ x (* y (/ t (- t a))))))
(if (<= t -4.1e-95)
t_2
(if (<= t 3.2e-128)
t_1
(if (<= t 9e-97)
t_2
(if (<= t 8.4e+23) t_1 (- x (* y (+ (/ z t) -1.0)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y * z) / (a - t));
double t_2 = x + (y * (t / (t - a)));
double tmp;
if (t <= -4.1e-95) {
tmp = t_2;
} else if (t <= 3.2e-128) {
tmp = t_1;
} else if (t <= 9e-97) {
tmp = t_2;
} else if (t <= 8.4e+23) {
tmp = t_1;
} else {
tmp = x - (y * ((z / t) + -1.0));
}
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 + ((y * z) / (a - t))
t_2 = x + (y * (t / (t - a)))
if (t <= (-4.1d-95)) then
tmp = t_2
else if (t <= 3.2d-128) then
tmp = t_1
else if (t <= 9d-97) then
tmp = t_2
else if (t <= 8.4d+23) then
tmp = t_1
else
tmp = x - (y * ((z / t) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y * z) / (a - t));
double t_2 = x + (y * (t / (t - a)));
double tmp;
if (t <= -4.1e-95) {
tmp = t_2;
} else if (t <= 3.2e-128) {
tmp = t_1;
} else if (t <= 9e-97) {
tmp = t_2;
} else if (t <= 8.4e+23) {
tmp = t_1;
} else {
tmp = x - (y * ((z / t) + -1.0));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y * z) / (a - t)) t_2 = x + (y * (t / (t - a))) tmp = 0 if t <= -4.1e-95: tmp = t_2 elif t <= 3.2e-128: tmp = t_1 elif t <= 9e-97: tmp = t_2 elif t <= 8.4e+23: tmp = t_1 else: tmp = x - (y * ((z / t) + -1.0)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y * z) / Float64(a - t))) t_2 = Float64(x + Float64(y * Float64(t / Float64(t - a)))) tmp = 0.0 if (t <= -4.1e-95) tmp = t_2; elseif (t <= 3.2e-128) tmp = t_1; elseif (t <= 9e-97) tmp = t_2; elseif (t <= 8.4e+23) tmp = t_1; else tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y * z) / (a - t)); t_2 = x + (y * (t / (t - a))); tmp = 0.0; if (t <= -4.1e-95) tmp = t_2; elseif (t <= 3.2e-128) tmp = t_1; elseif (t <= 9e-97) tmp = t_2; elseif (t <= 8.4e+23) tmp = t_1; else tmp = x - (y * ((z / t) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.1e-95], t$95$2, If[LessEqual[t, 3.2e-128], t$95$1, If[LessEqual[t, 9e-97], t$95$2, If[LessEqual[t, 8.4e+23], t$95$1, N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{a - t}\\
t_2 := x + y \cdot \frac{t}{t - a}\\
\mathbf{if}\;t \leq -4.1 \cdot 10^{-95}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-128}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-97}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 8.4 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\end{array}
\end{array}
if t < -4.0999999999999997e-95 or 3.1999999999999998e-128 < t < 9.0000000000000002e-97Initial program 97.8%
Taylor expanded in z around 0 63.8%
mul-1-neg63.8%
unsub-neg63.8%
*-commutative63.8%
associate-/l*84.2%
Simplified84.2%
if -4.0999999999999997e-95 < t < 3.1999999999999998e-128 or 9.0000000000000002e-97 < t < 8.4000000000000005e23Initial program 98.2%
Taylor expanded in z around inf 93.1%
if 8.4000000000000005e23 < t Initial program 99.9%
Taylor expanded in a around 0 80.6%
mul-1-neg80.6%
unsub-neg80.6%
associate-/l*94.6%
div-sub94.6%
sub-neg94.6%
*-inverses94.6%
metadata-eval94.6%
Simplified94.6%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1300000.0) (not (<= t 5.3e+23))) (+ x y) (- x (* (/ y a) (- t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1300000.0) || !(t <= 5.3e+23)) {
tmp = x + y;
} else {
tmp = x - ((y / a) * (t - z));
}
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 <= (-1300000.0d0)) .or. (.not. (t <= 5.3d+23))) then
tmp = x + y
else
tmp = x - ((y / a) * (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1300000.0) || !(t <= 5.3e+23)) {
tmp = x + y;
} else {
tmp = x - ((y / a) * (t - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1300000.0) or not (t <= 5.3e+23): tmp = x + y else: tmp = x - ((y / a) * (t - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1300000.0) || !(t <= 5.3e+23)) tmp = Float64(x + y); else tmp = Float64(x - Float64(Float64(y / a) * Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1300000.0) || ~((t <= 5.3e+23))) tmp = x + y; else tmp = x - ((y / a) * (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1300000.0], N[Not[LessEqual[t, 5.3e+23]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x - N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1300000 \lor \neg \left(t \leq 5.3 \cdot 10^{+23}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if t < -1.3e6 or 5.3000000000000001e23 < t Initial program 99.9%
Taylor expanded in t around inf 82.8%
+-commutative82.8%
Simplified82.8%
if -1.3e6 < t < 5.3000000000000001e23Initial program 97.3%
associate-*r/94.5%
Simplified94.5%
*-commutative94.5%
associate-/l*97.2%
Applied egg-rr97.2%
Taylor expanded in a around inf 79.4%
Final simplification80.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.35) (not (<= t 1e+24))) (+ x y) (+ x (/ (* y z) (- a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.35) || !(t <= 1e+24)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / (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 <= (-1.35d0)) .or. (.not. (t <= 1d+24))) then
tmp = x + y
else
tmp = x + ((y * z) / (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 <= -1.35) || !(t <= 1e+24)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.35) or not (t <= 1e+24): tmp = x + y else: tmp = x + ((y * z) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.35) || !(t <= 1e+24)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.35) || ~((t <= 1e+24))) tmp = x + y; else tmp = x + ((y * z) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.35], N[Not[LessEqual[t, 1e+24]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \lor \neg \left(t \leq 10^{+24}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\end{array}
\end{array}
if t < -1.3500000000000001 or 9.9999999999999998e23 < t Initial program 99.9%
Taylor expanded in t around inf 82.1%
+-commutative82.1%
Simplified82.1%
if -1.3500000000000001 < t < 9.9999999999999998e23Initial program 97.2%
Taylor expanded in z around inf 86.3%
Final simplification84.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -900000.0) (not (<= t 6.2e+23))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -900000.0) || !(t <= 6.2e+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 <= (-900000.0d0)) .or. (.not. (t <= 6.2d+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 <= -900000.0) || !(t <= 6.2e+23)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -900000.0) or not (t <= 6.2e+23): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -900000.0) || !(t <= 6.2e+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 <= -900000.0) || ~((t <= 6.2e+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, -900000.0], N[Not[LessEqual[t, 6.2e+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 -900000 \lor \neg \left(t \leq 6.2 \cdot 10^{+23}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -9e5 or 6.19999999999999941e23 < t Initial program 99.9%
Taylor expanded in t around inf 82.8%
+-commutative82.8%
Simplified82.8%
if -9e5 < t < 6.19999999999999941e23Initial program 97.3%
Taylor expanded in t around 0 72.8%
*-commutative72.8%
associate-/l*77.4%
Applied egg-rr77.4%
Final simplification79.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1200000.0) (not (<= t 5.5e+23))) (+ x y) (+ x (/ z (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1200000.0) || !(t <= 5.5e+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 <= (-1200000.0d0)) .or. (.not. (t <= 5.5d+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 <= -1200000.0) || !(t <= 5.5e+23)) {
tmp = x + y;
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1200000.0) or not (t <= 5.5e+23): tmp = x + y else: tmp = x + (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1200000.0) || !(t <= 5.5e+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 <= -1200000.0) || ~((t <= 5.5e+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, -1200000.0], N[Not[LessEqual[t, 5.5e+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 -1200000 \lor \neg \left(t \leq 5.5 \cdot 10^{+23}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -1.2e6 or 5.50000000000000004e23 < t Initial program 99.9%
Taylor expanded in t around inf 82.8%
+-commutative82.8%
Simplified82.8%
if -1.2e6 < t < 5.50000000000000004e23Initial program 97.3%
Taylor expanded in t around 0 72.8%
*-commutative72.8%
associate-/l*77.4%
Applied egg-rr77.4%
clear-num77.4%
div-inv77.5%
Applied egg-rr77.5%
Final simplification79.9%
(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 98.4%
Final simplification98.4%
(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 98.1%
Taylor expanded in t around inf 59.1%
+-commutative59.1%
Simplified59.1%
if 9.4999999999999997e56 < a Initial program 99.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 98.4%
Taylor expanded in x around inf 49.5%
Final simplification49.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
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) :: tmp
t_1 = x + (y * ((z - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024115
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))