
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\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)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* (/ (- z t) (- z a)) y)))
double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (z - a)) * y);
}
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 + (((z - t) / (z - a)) * y)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (z - a)) * y);
}
def code(x, y, z, t, a): return x + (((z - t) / (z - a)) * y)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(z - t) / Float64(z - a)) * y)) end
function tmp = code(x, y, z, t, a) tmp = x + (((z - t) / (z - a)) * y); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{z - a} \cdot y
\end{array}
Initial program 91.8%
associate-/l*98.8%
Simplified98.8%
clear-num98.8%
associate-/r/98.8%
clear-num98.9%
Applied egg-rr98.9%
Final simplification98.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (- 1.0 (/ t z))))))
(if (<= a -2.6e+42)
(+ x (/ y (/ a t)))
(if (<= a -8.2e-24)
t_1
(if (<= a -1e-55)
(* t (/ (- y) (- z a)))
(if (<= a -5.3e-174)
(+ x y)
(if (<= a 3.2e-117) t_1 (+ x (* y (/ t a))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (1.0 - (t / z)));
double tmp;
if (a <= -2.6e+42) {
tmp = x + (y / (a / t));
} else if (a <= -8.2e-24) {
tmp = t_1;
} else if (a <= -1e-55) {
tmp = t * (-y / (z - a));
} else if (a <= -5.3e-174) {
tmp = x + y;
} else if (a <= 3.2e-117) {
tmp = t_1;
} else {
tmp = x + (y * (t / 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) :: t_1
real(8) :: tmp
t_1 = x + (y * (1.0d0 - (t / z)))
if (a <= (-2.6d+42)) then
tmp = x + (y / (a / t))
else if (a <= (-8.2d-24)) then
tmp = t_1
else if (a <= (-1d-55)) then
tmp = t * (-y / (z - a))
else if (a <= (-5.3d-174)) then
tmp = x + y
else if (a <= 3.2d-117) then
tmp = t_1
else
tmp = x + (y * (t / a))
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 * (1.0 - (t / z)));
double tmp;
if (a <= -2.6e+42) {
tmp = x + (y / (a / t));
} else if (a <= -8.2e-24) {
tmp = t_1;
} else if (a <= -1e-55) {
tmp = t * (-y / (z - a));
} else if (a <= -5.3e-174) {
tmp = x + y;
} else if (a <= 3.2e-117) {
tmp = t_1;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (1.0 - (t / z))) tmp = 0 if a <= -2.6e+42: tmp = x + (y / (a / t)) elif a <= -8.2e-24: tmp = t_1 elif a <= -1e-55: tmp = t * (-y / (z - a)) elif a <= -5.3e-174: tmp = x + y elif a <= 3.2e-117: tmp = t_1 else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))) tmp = 0.0 if (a <= -2.6e+42) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (a <= -8.2e-24) tmp = t_1; elseif (a <= -1e-55) tmp = Float64(t * Float64(Float64(-y) / Float64(z - a))); elseif (a <= -5.3e-174) tmp = Float64(x + y); elseif (a <= 3.2e-117) tmp = t_1; else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (1.0 - (t / z))); tmp = 0.0; if (a <= -2.6e+42) tmp = x + (y / (a / t)); elseif (a <= -8.2e-24) tmp = t_1; elseif (a <= -1e-55) tmp = t * (-y / (z - a)); elseif (a <= -5.3e-174) tmp = x + y; elseif (a <= 3.2e-117) tmp = t_1; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.6e+42], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -8.2e-24], t$95$1, If[LessEqual[a, -1e-55], N[(t * N[((-y) / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -5.3e-174], N[(x + y), $MachinePrecision], If[LessEqual[a, 3.2e-117], t$95$1, N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{if}\;a \leq -2.6 \cdot 10^{+42}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;a \leq -8.2 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1 \cdot 10^{-55}:\\
\;\;\;\;t \cdot \frac{-y}{z - a}\\
\mathbf{elif}\;a \leq -5.3 \cdot 10^{-174}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{-117}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < -2.5999999999999999e42Initial program 92.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 82.7%
if -2.5999999999999999e42 < a < -8.20000000000000029e-24 or -5.2999999999999996e-174 < a < 3.19999999999999995e-117Initial program 94.1%
associate-/l*97.6%
Simplified97.6%
clear-num97.5%
associate-/r/97.7%
clear-num97.7%
Applied egg-rr97.7%
Taylor expanded in a around 0 92.7%
Taylor expanded in z around 0 92.7%
neg-mul-192.7%
sub-neg92.7%
Simplified92.7%
if -8.20000000000000029e-24 < a < -9.99999999999999995e-56Initial program 99.6%
associate-/l*100.0%
Simplified100.0%
clear-num100.0%
associate-/r/99.2%
clear-num99.2%
Applied egg-rr99.2%
Taylor expanded in t around inf 99.6%
associate-*r/99.6%
associate-*r*99.6%
neg-mul-199.6%
Simplified99.6%
div-inv99.2%
add-sqr-sqrt73.6%
sqrt-unprod74.7%
sqr-neg74.7%
sqrt-unprod0.1%
add-sqr-sqrt0.7%
distribute-lft-neg-in0.7%
cancel-sign-sub-inv0.7%
div-inv0.7%
associate-/l*0.7%
add-sqr-sqrt0.1%
sqrt-unprod74.7%
sqr-neg74.7%
sqrt-unprod73.6%
add-sqr-sqrt99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 99.6%
mul-1-neg99.6%
associate-*r/99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
Simplified99.6%
if -9.99999999999999995e-56 < a < -5.2999999999999996e-174Initial program 79.1%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 97.2%
+-commutative97.2%
Simplified97.2%
if 3.19999999999999995e-117 < a Initial program 90.7%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in z around 0 77.5%
+-commutative77.5%
associate-/l*80.7%
Simplified80.7%
associate-/r/82.0%
Applied egg-rr82.0%
Final simplification86.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (- 1.0 (/ t z))))))
(if (<= a -2.8e+41)
(+ x (/ y (/ a t)))
(if (<= a -8.2e-24)
t_1
(if (<= a -3.7e-58)
(* t (/ (- y) (- z a)))
(if (<= a -3.4e-174)
(+ x (* z (/ y (- z a))))
(if (<= a 3.2e-117) t_1 (+ x (* y (/ t a))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (1.0 - (t / z)));
double tmp;
if (a <= -2.8e+41) {
tmp = x + (y / (a / t));
} else if (a <= -8.2e-24) {
tmp = t_1;
} else if (a <= -3.7e-58) {
tmp = t * (-y / (z - a));
} else if (a <= -3.4e-174) {
tmp = x + (z * (y / (z - a)));
} else if (a <= 3.2e-117) {
tmp = t_1;
} else {
tmp = x + (y * (t / 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) :: t_1
real(8) :: tmp
t_1 = x + (y * (1.0d0 - (t / z)))
if (a <= (-2.8d+41)) then
tmp = x + (y / (a / t))
else if (a <= (-8.2d-24)) then
tmp = t_1
else if (a <= (-3.7d-58)) then
tmp = t * (-y / (z - a))
else if (a <= (-3.4d-174)) then
tmp = x + (z * (y / (z - a)))
else if (a <= 3.2d-117) then
tmp = t_1
else
tmp = x + (y * (t / a))
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 * (1.0 - (t / z)));
double tmp;
if (a <= -2.8e+41) {
tmp = x + (y / (a / t));
} else if (a <= -8.2e-24) {
tmp = t_1;
} else if (a <= -3.7e-58) {
tmp = t * (-y / (z - a));
} else if (a <= -3.4e-174) {
tmp = x + (z * (y / (z - a)));
} else if (a <= 3.2e-117) {
tmp = t_1;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (1.0 - (t / z))) tmp = 0 if a <= -2.8e+41: tmp = x + (y / (a / t)) elif a <= -8.2e-24: tmp = t_1 elif a <= -3.7e-58: tmp = t * (-y / (z - a)) elif a <= -3.4e-174: tmp = x + (z * (y / (z - a))) elif a <= 3.2e-117: tmp = t_1 else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))) tmp = 0.0 if (a <= -2.8e+41) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (a <= -8.2e-24) tmp = t_1; elseif (a <= -3.7e-58) tmp = Float64(t * Float64(Float64(-y) / Float64(z - a))); elseif (a <= -3.4e-174) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); elseif (a <= 3.2e-117) tmp = t_1; else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (1.0 - (t / z))); tmp = 0.0; if (a <= -2.8e+41) tmp = x + (y / (a / t)); elseif (a <= -8.2e-24) tmp = t_1; elseif (a <= -3.7e-58) tmp = t * (-y / (z - a)); elseif (a <= -3.4e-174) tmp = x + (z * (y / (z - a))); elseif (a <= 3.2e-117) tmp = t_1; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.8e+41], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -8.2e-24], t$95$1, If[LessEqual[a, -3.7e-58], N[(t * N[((-y) / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -3.4e-174], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.2e-117], t$95$1, N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{if}\;a \leq -2.8 \cdot 10^{+41}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;a \leq -8.2 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -3.7 \cdot 10^{-58}:\\
\;\;\;\;t \cdot \frac{-y}{z - a}\\
\mathbf{elif}\;a \leq -3.4 \cdot 10^{-174}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{-117}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < -2.7999999999999999e41Initial program 92.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 82.7%
if -2.7999999999999999e41 < a < -8.20000000000000029e-24 or -3.4000000000000002e-174 < a < 3.19999999999999995e-117Initial program 94.1%
associate-/l*97.6%
Simplified97.6%
clear-num97.5%
associate-/r/97.7%
clear-num97.7%
Applied egg-rr97.7%
Taylor expanded in a around 0 92.7%
Taylor expanded in z around 0 92.7%
neg-mul-192.7%
sub-neg92.7%
Simplified92.7%
if -8.20000000000000029e-24 < a < -3.7000000000000003e-58Initial program 99.6%
associate-/l*100.0%
Simplified100.0%
clear-num100.0%
associate-/r/99.2%
clear-num99.2%
Applied egg-rr99.2%
Taylor expanded in t around inf 99.6%
associate-*r/99.6%
associate-*r*99.6%
neg-mul-199.6%
Simplified99.6%
div-inv99.2%
add-sqr-sqrt73.6%
sqrt-unprod74.7%
sqr-neg74.7%
sqrt-unprod0.1%
add-sqr-sqrt0.7%
distribute-lft-neg-in0.7%
cancel-sign-sub-inv0.7%
div-inv0.7%
associate-/l*0.7%
add-sqr-sqrt0.1%
sqrt-unprod74.7%
sqr-neg74.7%
sqrt-unprod73.6%
add-sqr-sqrt99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 99.6%
mul-1-neg99.6%
associate-*r/99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
Simplified99.6%
if -3.7000000000000003e-58 < a < -3.4000000000000002e-174Initial program 79.1%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in t around 0 76.5%
+-commutative76.5%
associate-*l/97.2%
*-commutative97.2%
Simplified97.2%
if 3.19999999999999995e-117 < a Initial program 90.7%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in z around 0 77.5%
+-commutative77.5%
associate-/l*80.7%
Simplified80.7%
associate-/r/82.0%
Applied egg-rr82.0%
Final simplification86.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.45e-73)
(+ x (/ y (/ a t)))
(if (<= a -1.3e-181)
(+ x y)
(if (<= a 2e-121) (- x (* y (/ t z))) (+ x (* y (/ t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.45e-73) {
tmp = x + (y / (a / t));
} else if (a <= -1.3e-181) {
tmp = x + y;
} else if (a <= 2e-121) {
tmp = x - (y * (t / z));
} else {
tmp = x + (y * (t / 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 (a <= (-2.45d-73)) then
tmp = x + (y / (a / t))
else if (a <= (-1.3d-181)) then
tmp = x + y
else if (a <= 2d-121) then
tmp = x - (y * (t / z))
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.45e-73) {
tmp = x + (y / (a / t));
} else if (a <= -1.3e-181) {
tmp = x + y;
} else if (a <= 2e-121) {
tmp = x - (y * (t / z));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.45e-73: tmp = x + (y / (a / t)) elif a <= -1.3e-181: tmp = x + y elif a <= 2e-121: tmp = x - (y * (t / z)) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.45e-73) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (a <= -1.3e-181) tmp = Float64(x + y); elseif (a <= 2e-121) tmp = Float64(x - Float64(y * Float64(t / z))); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.45e-73) tmp = x + (y / (a / t)); elseif (a <= -1.3e-181) tmp = x + y; elseif (a <= 2e-121) tmp = x - (y * (t / z)); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.45e-73], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.3e-181], N[(x + y), $MachinePrecision], If[LessEqual[a, 2e-121], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.45 \cdot 10^{-73}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;a \leq -1.3 \cdot 10^{-181}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-121}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < -2.45000000000000014e-73Initial program 90.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 77.2%
if -2.45000000000000014e-73 < a < -1.29999999999999999e-181Initial program 83.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 92.4%
+-commutative92.4%
Simplified92.4%
if -1.29999999999999999e-181 < a < 2e-121Initial program 97.0%
associate-/l*97.1%
Simplified97.1%
clear-num97.0%
associate-/r/97.1%
clear-num97.1%
Applied egg-rr97.1%
Taylor expanded in t around inf 79.1%
associate-*r/79.1%
associate-*r*79.1%
neg-mul-179.1%
Simplified79.1%
Taylor expanded in z around inf 74.6%
mul-1-neg74.6%
unsub-neg74.6%
associate-/l*72.0%
Simplified72.0%
associate-/r/74.6%
Applied egg-rr74.6%
if 2e-121 < a Initial program 90.7%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in z around 0 77.5%
+-commutative77.5%
associate-/l*80.7%
Simplified80.7%
associate-/r/82.0%
Applied egg-rr82.0%
Final simplification79.2%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.55e-65)
(+ x (/ y (/ a t)))
(if (<= a -2.2e-185)
(+ x y)
(if (<= a 1.12e-117) (- x (/ (* t y) z)) (+ x (* y (/ t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.55e-65) {
tmp = x + (y / (a / t));
} else if (a <= -2.2e-185) {
tmp = x + y;
} else if (a <= 1.12e-117) {
tmp = x - ((t * y) / z);
} else {
tmp = x + (y * (t / 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 (a <= (-2.55d-65)) then
tmp = x + (y / (a / t))
else if (a <= (-2.2d-185)) then
tmp = x + y
else if (a <= 1.12d-117) then
tmp = x - ((t * y) / z)
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.55e-65) {
tmp = x + (y / (a / t));
} else if (a <= -2.2e-185) {
tmp = x + y;
} else if (a <= 1.12e-117) {
tmp = x - ((t * y) / z);
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.55e-65: tmp = x + (y / (a / t)) elif a <= -2.2e-185: tmp = x + y elif a <= 1.12e-117: tmp = x - ((t * y) / z) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.55e-65) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (a <= -2.2e-185) tmp = Float64(x + y); elseif (a <= 1.12e-117) tmp = Float64(x - Float64(Float64(t * y) / z)); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.55e-65) tmp = x + (y / (a / t)); elseif (a <= -2.2e-185) tmp = x + y; elseif (a <= 1.12e-117) tmp = x - ((t * y) / z); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.55e-65], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2.2e-185], N[(x + y), $MachinePrecision], If[LessEqual[a, 1.12e-117], N[(x - N[(N[(t * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.55 \cdot 10^{-65}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;a \leq -2.2 \cdot 10^{-185}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 1.12 \cdot 10^{-117}:\\
\;\;\;\;x - \frac{t \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < -2.55e-65Initial program 90.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 77.2%
if -2.55e-65 < a < -2.2e-185Initial program 83.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 92.4%
+-commutative92.4%
Simplified92.4%
if -2.2e-185 < a < 1.12e-117Initial program 97.0%
associate-/l*97.1%
Simplified97.1%
clear-num97.0%
associate-/r/97.1%
clear-num97.1%
Applied egg-rr97.1%
Taylor expanded in t around inf 79.1%
associate-*r/79.1%
associate-*r*79.1%
neg-mul-179.1%
Simplified79.1%
div-inv79.0%
add-sqr-sqrt47.8%
sqrt-unprod48.8%
sqr-neg48.8%
sqrt-unprod10.5%
add-sqr-sqrt33.0%
distribute-lft-neg-in33.0%
cancel-sign-sub-inv33.0%
div-inv33.0%
associate-/l*31.6%
add-sqr-sqrt10.5%
sqrt-unprod46.4%
sqr-neg46.4%
sqrt-unprod43.9%
add-sqr-sqrt74.9%
Applied egg-rr74.9%
Taylor expanded in z around inf 74.6%
if 1.12e-117 < a Initial program 90.7%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in z around 0 77.5%
+-commutative77.5%
associate-/l*80.7%
Simplified80.7%
associate-/r/82.0%
Applied egg-rr82.0%
Final simplification79.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.05e+173) x (if (or (<= a 2.4e-185) (not (<= a 2.9e-174))) (+ x y) (* t (/ (- y) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.05e+173) {
tmp = x;
} else if ((a <= 2.4e-185) || !(a <= 2.9e-174)) {
tmp = x + y;
} else {
tmp = t * (-y / 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 (a <= (-2.05d+173)) then
tmp = x
else if ((a <= 2.4d-185) .or. (.not. (a <= 2.9d-174))) then
tmp = x + y
else
tmp = t * (-y / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.05e+173) {
tmp = x;
} else if ((a <= 2.4e-185) || !(a <= 2.9e-174)) {
tmp = x + y;
} else {
tmp = t * (-y / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.05e+173: tmp = x elif (a <= 2.4e-185) or not (a <= 2.9e-174): tmp = x + y else: tmp = t * (-y / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.05e+173) tmp = x; elseif ((a <= 2.4e-185) || !(a <= 2.9e-174)) tmp = Float64(x + y); else tmp = Float64(t * Float64(Float64(-y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.05e+173) tmp = x; elseif ((a <= 2.4e-185) || ~((a <= 2.9e-174))) tmp = x + y; else tmp = t * (-y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.05e+173], x, If[Or[LessEqual[a, 2.4e-185], N[Not[LessEqual[a, 2.9e-174]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(t * N[((-y) / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.05 \cdot 10^{+173}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-185} \lor \neg \left(a \leq 2.9 \cdot 10^{-174}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{-y}{z}\\
\end{array}
\end{array}
if a < -2.04999999999999988e173Initial program 92.7%
associate-*l/94.0%
Simplified94.0%
Taylor expanded in x around inf 73.8%
if -2.04999999999999988e173 < a < 2.4000000000000001e-185 or 2.9000000000000001e-174 < a Initial program 91.5%
associate-*l/94.8%
Simplified94.8%
Taylor expanded in z around inf 63.4%
+-commutative63.4%
Simplified63.4%
if 2.4000000000000001e-185 < a < 2.9000000000000001e-174Initial program 99.7%
associate-/l*99.7%
Simplified99.7%
clear-num99.7%
associate-/r/99.7%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in t around inf 99.7%
associate-*r/99.7%
associate-*r*99.7%
neg-mul-199.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
mul-1-neg99.7%
unsub-neg99.7%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in x around 0 99.7%
associate-*r/100.0%
neg-mul-1100.0%
distribute-rgt-neg-in100.0%
distribute-neg-frac100.0%
Simplified100.0%
Final simplification65.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.2e-15) (not (<= t 1.15e-59))) (- x (/ t (/ (- z a) y))) (+ x (* z (/ y (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e-15) || !(t <= 1.15e-59)) {
tmp = x - (t / ((z - a) / y));
} else {
tmp = x + (z * (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 <= (-2.2d-15)) .or. (.not. (t <= 1.15d-59))) then
tmp = x - (t / ((z - a) / y))
else
tmp = x + (z * (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 <= -2.2e-15) || !(t <= 1.15e-59)) {
tmp = x - (t / ((z - a) / y));
} else {
tmp = x + (z * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.2e-15) or not (t <= 1.15e-59): tmp = x - (t / ((z - a) / y)) else: tmp = x + (z * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.2e-15) || !(t <= 1.15e-59)) tmp = Float64(x - Float64(t / Float64(Float64(z - a) / y))); else tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.2e-15) || ~((t <= 1.15e-59))) tmp = x - (t / ((z - a) / y)); else tmp = x + (z * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.2e-15], N[Not[LessEqual[t, 1.15e-59]], $MachinePrecision]], N[(x - N[(t / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{-15} \lor \neg \left(t \leq 1.15 \cdot 10^{-59}\right):\\
\;\;\;\;x - \frac{t}{\frac{z - a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if t < -2.19999999999999986e-15 or 1.1499999999999999e-59 < t Initial program 89.5%
associate-/l*98.5%
Simplified98.5%
clear-num98.4%
associate-/r/98.5%
clear-num98.5%
Applied egg-rr98.5%
Taylor expanded in t around inf 85.0%
associate-*r/85.0%
associate-*r*85.0%
neg-mul-185.0%
Simplified85.0%
div-inv85.0%
add-sqr-sqrt47.7%
sqrt-unprod45.2%
sqr-neg45.2%
sqrt-unprod16.0%
add-sqr-sqrt40.2%
distribute-lft-neg-in40.2%
cancel-sign-sub-inv40.2%
div-inv40.2%
associate-/l*41.9%
add-sqr-sqrt16.2%
sqrt-unprod46.2%
sqr-neg46.2%
sqrt-unprod50.5%
add-sqr-sqrt89.1%
Applied egg-rr89.1%
if -2.19999999999999986e-15 < t < 1.1499999999999999e-59Initial program 94.4%
associate-*l/94.4%
Simplified94.4%
Taylor expanded in t around 0 89.4%
+-commutative89.4%
associate-*l/91.7%
*-commutative91.7%
Simplified91.7%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.32e+111) (not (<= z 2.05e+91))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.32e+111) || !(z <= 2.05e+91)) {
tmp = x + y;
} else {
tmp = x + (t * (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 ((z <= (-2.32d+111)) .or. (.not. (z <= 2.05d+91))) then
tmp = x + y
else
tmp = x + (t * (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 ((z <= -2.32e+111) || !(z <= 2.05e+91)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.32e+111) or not (z <= 2.05e+91): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.32e+111) || !(z <= 2.05e+91)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.32e+111) || ~((z <= 2.05e+91))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.32e+111], N[Not[LessEqual[z, 2.05e+91]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.32 \cdot 10^{+111} \lor \neg \left(z \leq 2.05 \cdot 10^{+91}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.32e111 or 2.0500000000000001e91 < z Initial program 82.4%
associate-*l/92.5%
Simplified92.5%
Taylor expanded in z around inf 82.7%
+-commutative82.7%
Simplified82.7%
if -2.32e111 < z < 2.0500000000000001e91Initial program 96.5%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in z around 0 73.3%
associate-/r/70.4%
Applied egg-rr70.4%
Final simplification74.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.32e+111) (not (<= z 2.05e+91))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.32e+111) || !(z <= 2.05e+91)) {
tmp = x + y;
} else {
tmp = x + (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 ((z <= (-2.32d+111)) .or. (.not. (z <= 2.05d+91))) then
tmp = x + y
else
tmp = x + (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 ((z <= -2.32e+111) || !(z <= 2.05e+91)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.32e+111) or not (z <= 2.05e+91): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.32e+111) || !(z <= 2.05e+91)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.32e+111) || ~((z <= 2.05e+91))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.32e+111], N[Not[LessEqual[z, 2.05e+91]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.32 \cdot 10^{+111} \lor \neg \left(z \leq 2.05 \cdot 10^{+91}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -2.32e111 or 2.0500000000000001e91 < z Initial program 82.4%
associate-*l/92.5%
Simplified92.5%
Taylor expanded in z around inf 82.7%
+-commutative82.7%
Simplified82.7%
if -2.32e111 < z < 2.0500000000000001e91Initial program 96.5%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in z around 0 73.3%
Final simplification76.4%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (z - a)));
}
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 + ((z - t) * (y / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (z - a)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{z - a}
\end{array}
Initial program 91.8%
associate-*l/94.8%
Simplified94.8%
Final simplification94.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.5e+174) x (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.5e+174) {
tmp = x;
} 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 (a <= (-3.5d+174)) then
tmp = x
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 (a <= -3.5e+174) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.5e+174: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.5e+174) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.5e+174) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.5e+174], x, N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{+174}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -3.5000000000000001e174Initial program 92.7%
associate-*l/94.0%
Simplified94.0%
Taylor expanded in x around inf 73.8%
if -3.5000000000000001e174 < a Initial program 91.7%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in z around inf 62.0%
+-commutative62.0%
Simplified62.0%
Final simplification63.8%
(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 91.8%
associate-*l/94.8%
Simplified94.8%
Taylor expanded in x around inf 54.6%
Final simplification54.6%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (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 / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024034
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))