
(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 (/ (- 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}
Initial program 97.9%
clear-num97.6%
un-div-inv98.1%
Applied egg-rr98.1%
Final simplification98.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -5.7e+217)
(+ x y)
(if (<= t -4e+80)
(+ x (* y (/ z (- a t))))
(if (or (<= t -6.6e+53) (not (<= t 1.55e+52)))
(+ x y)
(+ x (/ (* y z) (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.7e+217) {
tmp = x + y;
} else if (t <= -4e+80) {
tmp = x + (y * (z / (a - t)));
} else if ((t <= -6.6e+53) || !(t <= 1.55e+52)) {
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 <= (-5.7d+217)) then
tmp = x + y
else if (t <= (-4d+80)) then
tmp = x + (y * (z / (a - t)))
else if ((t <= (-6.6d+53)) .or. (.not. (t <= 1.55d+52))) 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 <= -5.7e+217) {
tmp = x + y;
} else if (t <= -4e+80) {
tmp = x + (y * (z / (a - t)));
} else if ((t <= -6.6e+53) || !(t <= 1.55e+52)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.7e+217: tmp = x + y elif t <= -4e+80: tmp = x + (y * (z / (a - t))) elif (t <= -6.6e+53) or not (t <= 1.55e+52): tmp = x + y else: tmp = x + ((y * z) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.7e+217) tmp = Float64(x + y); elseif (t <= -4e+80) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); elseif ((t <= -6.6e+53) || !(t <= 1.55e+52)) 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 <= -5.7e+217) tmp = x + y; elseif (t <= -4e+80) tmp = x + (y * (z / (a - t))); elseif ((t <= -6.6e+53) || ~((t <= 1.55e+52))) tmp = x + y; else tmp = x + ((y * z) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.7e+217], N[(x + y), $MachinePrecision], If[LessEqual[t, -4e+80], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -6.6e+53], N[Not[LessEqual[t, 1.55e+52]], $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 -5.7 \cdot 10^{+217}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -4 \cdot 10^{+80}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{elif}\;t \leq -6.6 \cdot 10^{+53} \lor \neg \left(t \leq 1.55 \cdot 10^{+52}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\end{array}
\end{array}
if t < -5.6999999999999998e217 or -4e80 < t < -6.6000000000000004e53 or 1.55e52 < t Initial program 99.9%
Taylor expanded in t around inf 86.7%
+-commutative86.7%
Simplified86.7%
if -5.6999999999999998e217 < t < -4e80Initial program 99.9%
Taylor expanded in z around inf 49.3%
associate-/l*71.0%
Simplified71.0%
if -6.6000000000000004e53 < t < 1.55e52Initial program 96.8%
Taylor expanded in z around inf 88.6%
Final simplification86.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* t (/ y (- t a))))))
(if (<= t -2.5e+97)
t_1
(if (<= t -5.4e-53)
(+ x (* y (/ z (- a t))))
(if (or (<= t -5.3e-70) (not (<= t 1.65e+45)))
t_1
(+ x (/ (* y z) (- a t))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t * (y / (t - a)));
double tmp;
if (t <= -2.5e+97) {
tmp = t_1;
} else if (t <= -5.4e-53) {
tmp = x + (y * (z / (a - t)));
} else if ((t <= -5.3e-70) || !(t <= 1.65e+45)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (t * (y / (t - a)))
if (t <= (-2.5d+97)) then
tmp = t_1
else if (t <= (-5.4d-53)) then
tmp = x + (y * (z / (a - t)))
else if ((t <= (-5.3d-70)) .or. (.not. (t <= 1.65d+45))) then
tmp = t_1
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 t_1 = x + (t * (y / (t - a)));
double tmp;
if (t <= -2.5e+97) {
tmp = t_1;
} else if (t <= -5.4e-53) {
tmp = x + (y * (z / (a - t)));
} else if ((t <= -5.3e-70) || !(t <= 1.65e+45)) {
tmp = t_1;
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t * (y / (t - a))) tmp = 0 if t <= -2.5e+97: tmp = t_1 elif t <= -5.4e-53: tmp = x + (y * (z / (a - t))) elif (t <= -5.3e-70) or not (t <= 1.65e+45): tmp = t_1 else: tmp = x + ((y * z) / (a - t)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t * Float64(y / Float64(t - a)))) tmp = 0.0 if (t <= -2.5e+97) tmp = t_1; elseif (t <= -5.4e-53) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); elseif ((t <= -5.3e-70) || !(t <= 1.65e+45)) tmp = t_1; else tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t * (y / (t - a))); tmp = 0.0; if (t <= -2.5e+97) tmp = t_1; elseif (t <= -5.4e-53) tmp = x + (y * (z / (a - t))); elseif ((t <= -5.3e-70) || ~((t <= 1.65e+45))) tmp = t_1; else tmp = x + ((y * z) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.5e+97], t$95$1, If[LessEqual[t, -5.4e-53], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -5.3e-70], N[Not[LessEqual[t, 1.65e+45]], $MachinePrecision]], t$95$1, N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot \frac{y}{t - a}\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{+97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -5.4 \cdot 10^{-53}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{elif}\;t \leq -5.3 \cdot 10^{-70} \lor \neg \left(t \leq 1.65 \cdot 10^{+45}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\end{array}
\end{array}
if t < -2.49999999999999999e97 or -5.3999999999999998e-53 < t < -5.29999999999999983e-70 or 1.65e45 < t Initial program 99.9%
Taylor expanded in z around 0 69.6%
mul-1-neg69.6%
unsub-neg69.6%
associate-/l*86.1%
Simplified86.1%
if -2.49999999999999999e97 < t < -5.3999999999999998e-53Initial program 100.0%
Taylor expanded in z around inf 79.8%
associate-/l*88.3%
Simplified88.3%
if -5.29999999999999983e-70 < t < 1.65e45Initial program 96.0%
Taylor expanded in z around inf 91.1%
Final simplification88.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.5e+56)
(- x (* y (+ (/ z t) -1.0)))
(if (<= t -1.12e-54)
(+ x (* y (/ z (- a t))))
(if (or (<= t -1.35e-70) (not (<= t 1.95e+45)))
(+ x (* t (/ y (- t a))))
(+ x (/ (* y z) (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.5e+56) {
tmp = x - (y * ((z / t) + -1.0));
} else if (t <= -1.12e-54) {
tmp = x + (y * (z / (a - t)));
} else if ((t <= -1.35e-70) || !(t <= 1.95e+45)) {
tmp = x + (t * (y / (t - a)));
} 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 <= (-3.5d+56)) then
tmp = x - (y * ((z / t) + (-1.0d0)))
else if (t <= (-1.12d-54)) then
tmp = x + (y * (z / (a - t)))
else if ((t <= (-1.35d-70)) .or. (.not. (t <= 1.95d+45))) then
tmp = x + (t * (y / (t - a)))
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 <= -3.5e+56) {
tmp = x - (y * ((z / t) + -1.0));
} else if (t <= -1.12e-54) {
tmp = x + (y * (z / (a - t)));
} else if ((t <= -1.35e-70) || !(t <= 1.95e+45)) {
tmp = x + (t * (y / (t - a)));
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.5e+56: tmp = x - (y * ((z / t) + -1.0)) elif t <= -1.12e-54: tmp = x + (y * (z / (a - t))) elif (t <= -1.35e-70) or not (t <= 1.95e+45): tmp = x + (t * (y / (t - a))) else: tmp = x + ((y * z) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.5e+56) tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); elseif (t <= -1.12e-54) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); elseif ((t <= -1.35e-70) || !(t <= 1.95e+45)) tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); 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 <= -3.5e+56) tmp = x - (y * ((z / t) + -1.0)); elseif (t <= -1.12e-54) tmp = x + (y * (z / (a - t))); elseif ((t <= -1.35e-70) || ~((t <= 1.95e+45))) tmp = x + (t * (y / (t - a))); else tmp = x + ((y * z) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.5e+56], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.12e-54], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1.35e-70], N[Not[LessEqual[t, 1.95e+45]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+56}:\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{elif}\;t \leq -1.12 \cdot 10^{-54}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{elif}\;t \leq -1.35 \cdot 10^{-70} \lor \neg \left(t \leq 1.95 \cdot 10^{+45}\right):\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\end{array}
\end{array}
if t < -3.49999999999999999e56Initial program 99.9%
Taylor expanded in a around 0 56.6%
mul-1-neg56.6%
unsub-neg56.6%
associate-/l*81.2%
div-sub81.2%
sub-neg81.2%
*-inverses81.2%
metadata-eval81.2%
Simplified81.2%
if -3.49999999999999999e56 < t < -1.11999999999999994e-54Initial program 99.9%
Taylor expanded in z around inf 91.3%
associate-/l*95.3%
Simplified95.3%
if -1.11999999999999994e-54 < t < -1.3500000000000001e-70 or 1.95e45 < t Initial program 99.9%
Taylor expanded in z around 0 76.6%
mul-1-neg76.6%
unsub-neg76.6%
associate-/l*90.5%
Simplified90.5%
if -1.3500000000000001e-70 < t < 1.95e45Initial program 96.0%
Taylor expanded in z around inf 91.1%
Final simplification89.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.04e+217) (not (<= t 1.7e+52))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.04e+217) || !(t <= 1.7e+52)) {
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.04d+217)) .or. (.not. (t <= 1.7d+52))) 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.04e+217) || !(t <= 1.7e+52)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.04e+217) or not (t <= 1.7e+52): 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.04e+217) || !(t <= 1.7e+52)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.04e+217) || ~((t <= 1.7e+52))) 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.04e+217], N[Not[LessEqual[t, 1.7e+52]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.04 \cdot 10^{+217} \lor \neg \left(t \leq 1.7 \cdot 10^{+52}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -1.0399999999999999e217 or 1.7e52 < t Initial program 99.9%
Taylor expanded in t around inf 85.9%
+-commutative85.9%
Simplified85.9%
if -1.0399999999999999e217 < t < 1.7e52Initial program 97.3%
Taylor expanded in z around inf 82.1%
associate-/l*83.4%
Simplified83.4%
Final simplification84.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.04e+217) (not (<= t 9.4e+52))) (+ x y) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.04e+217) || !(t <= 9.4e+52)) {
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 <= (-1.04d+217)) .or. (.not. (t <= 9.4d+52))) 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 <= -1.04e+217) || !(t <= 9.4e+52)) {
tmp = x + y;
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.04e+217) or not (t <= 9.4e+52): tmp = x + y else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.04e+217) || !(t <= 9.4e+52)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.04e+217) || ~((t <= 9.4e+52))) 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, -1.04e+217], N[Not[LessEqual[t, 9.4e+52]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.04 \cdot 10^{+217} \lor \neg \left(t \leq 9.4 \cdot 10^{+52}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -1.0399999999999999e217 or 9.3999999999999999e52 < t Initial program 99.9%
Taylor expanded in t around inf 85.9%
+-commutative85.9%
Simplified85.9%
if -1.0399999999999999e217 < t < 9.3999999999999999e52Initial program 97.3%
clear-num96.9%
un-div-inv97.4%
Applied egg-rr97.4%
Taylor expanded in z around inf 83.6%
Final simplification84.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4e-80) (not (<= t 6e+50))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4e-80) || !(t <= 6e+50)) {
tmp = x + y;
} else {
tmp = x + (y / (a / 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 <= (-4d-80)) .or. (.not. (t <= 6d+50))) then
tmp = x + y
else
tmp = x + (y / (a / 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 <= -4e-80) || !(t <= 6e+50)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4e-80) or not (t <= 6e+50): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4e-80) || !(t <= 6e+50)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4e-80) || ~((t <= 6e+50))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4e-80], N[Not[LessEqual[t, 6e+50]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-80} \lor \neg \left(t \leq 6 \cdot 10^{+50}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -3.99999999999999985e-80 or 5.9999999999999996e50 < t Initial program 99.9%
Taylor expanded in t around inf 76.1%
+-commutative76.1%
Simplified76.1%
if -3.99999999999999985e-80 < t < 5.9999999999999996e50Initial program 95.9%
clear-num95.3%
un-div-inv96.2%
Applied egg-rr96.2%
Taylor expanded in t around 0 79.6%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.8e-80) (not (<= t 1.95e+52))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.8e-80) || !(t <= 1.95e+52)) {
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 <= (-3.8d-80)) .or. (.not. (t <= 1.95d+52))) 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 <= -3.8e-80) || !(t <= 1.95e+52)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.8e-80) or not (t <= 1.95e+52): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.8e-80) || !(t <= 1.95e+52)) 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 <= -3.8e-80) || ~((t <= 1.95e+52))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.8e-80], N[Not[LessEqual[t, 1.95e+52]], $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 -3.8 \cdot 10^{-80} \lor \neg \left(t \leq 1.95 \cdot 10^{+52}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -3.79999999999999967e-80 or 1.95e52 < t Initial program 99.9%
Taylor expanded in t around inf 76.1%
+-commutative76.1%
Simplified76.1%
if -3.79999999999999967e-80 < t < 1.95e52Initial program 95.9%
Taylor expanded in t around 0 79.6%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -9.6e+199) x (if (<= a 1.7e+58) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.6e+199) {
tmp = x;
} else if (a <= 1.7e+58) {
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.6d+199)) then
tmp = x
else if (a <= 1.7d+58) 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.6e+199) {
tmp = x;
} else if (a <= 1.7e+58) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9.6e+199: tmp = x elif a <= 1.7e+58: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.6e+199) tmp = x; elseif (a <= 1.7e+58) 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.6e+199) tmp = x; elseif (a <= 1.7e+58) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.6e+199], x, If[LessEqual[a, 1.7e+58], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.6 \cdot 10^{+199}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{+58}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -9.60000000000000059e199 or 1.7e58 < a Initial program 99.6%
Taylor expanded in x around inf 69.6%
if -9.60000000000000059e199 < a < 1.7e58Initial program 97.4%
Taylor expanded in t around inf 63.5%
+-commutative63.5%
Simplified63.5%
Final simplification65.1%
(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 97.9%
Final simplification97.9%
(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 97.9%
Taylor expanded in x around inf 53.9%
Final simplification53.9%
(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 2024053
(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)))))