
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 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(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 87.0%
associate-/l*98.3%
Simplified98.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- y (* y (/ z t))))))
(if (<= t -2e+125)
t_1
(if (<= t -2.9e-89)
(+ x (* t (/ y (- t a))))
(if (<= t 6.8e+40) (+ x (/ (* y z) (- a t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y - (y * (z / t)));
double tmp;
if (t <= -2e+125) {
tmp = t_1;
} else if (t <= -2.9e-89) {
tmp = x + (t * (y / (t - a)));
} else if (t <= 6.8e+40) {
tmp = x + ((y * z) / (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 - (y * (z / t)))
if (t <= (-2d+125)) then
tmp = t_1
else if (t <= (-2.9d-89)) then
tmp = x + (t * (y / (t - a)))
else if (t <= 6.8d+40) then
tmp = x + ((y * z) / (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 - (y * (z / t)));
double tmp;
if (t <= -2e+125) {
tmp = t_1;
} else if (t <= -2.9e-89) {
tmp = x + (t * (y / (t - a)));
} else if (t <= 6.8e+40) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y - (y * (z / t))) tmp = 0 if t <= -2e+125: tmp = t_1 elif t <= -2.9e-89: tmp = x + (t * (y / (t - a))) elif t <= 6.8e+40: tmp = x + ((y * z) / (a - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y - Float64(y * Float64(z / t)))) tmp = 0.0 if (t <= -2e+125) tmp = t_1; elseif (t <= -2.9e-89) tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); elseif (t <= 6.8e+40) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y - (y * (z / t))); tmp = 0.0; if (t <= -2e+125) tmp = t_1; elseif (t <= -2.9e-89) tmp = x + (t * (y / (t - a))); elseif (t <= 6.8e+40) tmp = x + ((y * z) / (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[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2e+125], t$95$1, If[LessEqual[t, -2.9e-89], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.8e+40], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - y \cdot \frac{z}{t}\right)\\
\mathbf{if}\;t \leq -2 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.9 \cdot 10^{-89}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{+40}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.9999999999999998e125 or 6.79999999999999977e40 < t Initial program 66.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 61.7%
mul-1-neg61.7%
associate-/l*92.1%
distribute-lft-neg-in92.1%
div-sub92.1%
sub-neg92.1%
*-inverses92.1%
metadata-eval92.1%
Simplified92.1%
Taylor expanded in z around 0 80.9%
mul-1-neg80.9%
associate-*r/92.1%
unsub-neg92.1%
Simplified92.1%
if -1.9999999999999998e125 < t < -2.89999999999999992e-89Initial program 98.3%
*-commutative98.3%
associate-/l*96.6%
Applied egg-rr96.6%
Taylor expanded in z around 0 87.2%
mul-1-neg87.2%
associate-/l*87.2%
distribute-lft-neg-out87.2%
*-commutative87.2%
Simplified87.2%
associate-*l/87.2%
frac-2neg87.2%
add-sqr-sqrt87.0%
sqrt-unprod87.2%
sqr-neg87.2%
sqrt-unprod0.0%
add-sqr-sqrt63.7%
distribute-rgt-neg-out63.7%
add-sqr-sqrt63.7%
sqrt-unprod63.7%
sqr-neg63.7%
sqrt-unprod0.0%
add-sqr-sqrt87.2%
sub-neg87.2%
distribute-neg-in87.2%
add-sqr-sqrt87.0%
sqrt-unprod87.2%
sqr-neg87.2%
sqrt-unprod0.0%
add-sqr-sqrt74.8%
add-sqr-sqrt74.8%
sqrt-unprod74.8%
sqr-neg74.8%
sqrt-unprod0.0%
add-sqr-sqrt87.2%
Applied egg-rr87.2%
*-commutative87.2%
associate-/l*87.2%
+-commutative87.2%
unsub-neg87.2%
Simplified87.2%
if -2.89999999999999992e-89 < t < 6.79999999999999977e40Initial program 98.7%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in z around inf 89.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- y (* y (/ z t))))))
(if (<= t -1.02e+124)
t_1
(if (<= t -2.8e-89)
(+ x (* t (/ y (- t a))))
(if (<= t 4.8e+40) (+ x (/ y (/ (- a t) z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y - (y * (z / t)));
double tmp;
if (t <= -1.02e+124) {
tmp = t_1;
} else if (t <= -2.8e-89) {
tmp = x + (t * (y / (t - a)));
} else if (t <= 4.8e+40) {
tmp = x + (y / ((a - t) / z));
} 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 - (y * (z / t)))
if (t <= (-1.02d+124)) then
tmp = t_1
else if (t <= (-2.8d-89)) then
tmp = x + (t * (y / (t - a)))
else if (t <= 4.8d+40) then
tmp = x + (y / ((a - t) / z))
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 - (y * (z / t)));
double tmp;
if (t <= -1.02e+124) {
tmp = t_1;
} else if (t <= -2.8e-89) {
tmp = x + (t * (y / (t - a)));
} else if (t <= 4.8e+40) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y - (y * (z / t))) tmp = 0 if t <= -1.02e+124: tmp = t_1 elif t <= -2.8e-89: tmp = x + (t * (y / (t - a))) elif t <= 4.8e+40: tmp = x + (y / ((a - t) / z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y - Float64(y * Float64(z / t)))) tmp = 0.0 if (t <= -1.02e+124) tmp = t_1; elseif (t <= -2.8e-89) tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); elseif (t <= 4.8e+40) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y - (y * (z / t))); tmp = 0.0; if (t <= -1.02e+124) tmp = t_1; elseif (t <= -2.8e-89) tmp = x + (t * (y / (t - a))); elseif (t <= 4.8e+40) tmp = x + (y / ((a - t) / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.02e+124], t$95$1, If[LessEqual[t, -2.8e-89], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e+40], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - y \cdot \frac{z}{t}\right)\\
\mathbf{if}\;t \leq -1.02 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.8 \cdot 10^{-89}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{+40}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.01999999999999994e124 or 4.8e40 < t Initial program 66.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 61.7%
mul-1-neg61.7%
associate-/l*92.1%
distribute-lft-neg-in92.1%
div-sub92.1%
sub-neg92.1%
*-inverses92.1%
metadata-eval92.1%
Simplified92.1%
Taylor expanded in z around 0 80.9%
mul-1-neg80.9%
associate-*r/92.1%
unsub-neg92.1%
Simplified92.1%
if -1.01999999999999994e124 < t < -2.7999999999999999e-89Initial program 98.3%
*-commutative98.3%
associate-/l*96.6%
Applied egg-rr96.6%
Taylor expanded in z around 0 87.2%
mul-1-neg87.2%
associate-/l*87.2%
distribute-lft-neg-out87.2%
*-commutative87.2%
Simplified87.2%
associate-*l/87.2%
frac-2neg87.2%
add-sqr-sqrt87.0%
sqrt-unprod87.2%
sqr-neg87.2%
sqrt-unprod0.0%
add-sqr-sqrt63.7%
distribute-rgt-neg-out63.7%
add-sqr-sqrt63.7%
sqrt-unprod63.7%
sqr-neg63.7%
sqrt-unprod0.0%
add-sqr-sqrt87.2%
sub-neg87.2%
distribute-neg-in87.2%
add-sqr-sqrt87.0%
sqrt-unprod87.2%
sqr-neg87.2%
sqrt-unprod0.0%
add-sqr-sqrt74.8%
add-sqr-sqrt74.8%
sqrt-unprod74.8%
sqr-neg74.8%
sqrt-unprod0.0%
add-sqr-sqrt87.2%
Applied egg-rr87.2%
*-commutative87.2%
associate-/l*87.2%
+-commutative87.2%
unsub-neg87.2%
Simplified87.2%
if -2.7999999999999999e-89 < t < 4.8e40Initial program 98.7%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in z around inf 89.0%
associate-/l*87.4%
Simplified87.4%
clear-num87.3%
un-div-inv88.8%
Applied egg-rr88.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- y (* y (/ z t))))))
(if (<= t -5.2e+122)
t_1
(if (<= t -2.95e-89)
(+ x (* t (/ y (- t a))))
(if (<= t 3.3e+40) (+ x (* y (/ z (- a t)))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y - (y * (z / t)));
double tmp;
if (t <= -5.2e+122) {
tmp = t_1;
} else if (t <= -2.95e-89) {
tmp = x + (t * (y / (t - a)));
} else if (t <= 3.3e+40) {
tmp = x + (y * (z / (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 - (y * (z / t)))
if (t <= (-5.2d+122)) then
tmp = t_1
else if (t <= (-2.95d-89)) then
tmp = x + (t * (y / (t - a)))
else if (t <= 3.3d+40) then
tmp = x + (y * (z / (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 - (y * (z / t)));
double tmp;
if (t <= -5.2e+122) {
tmp = t_1;
} else if (t <= -2.95e-89) {
tmp = x + (t * (y / (t - a)));
} else if (t <= 3.3e+40) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y - (y * (z / t))) tmp = 0 if t <= -5.2e+122: tmp = t_1 elif t <= -2.95e-89: tmp = x + (t * (y / (t - a))) elif t <= 3.3e+40: tmp = x + (y * (z / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y - Float64(y * Float64(z / t)))) tmp = 0.0 if (t <= -5.2e+122) tmp = t_1; elseif (t <= -2.95e-89) tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); elseif (t <= 3.3e+40) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y - (y * (z / t))); tmp = 0.0; if (t <= -5.2e+122) tmp = t_1; elseif (t <= -2.95e-89) tmp = x + (t * (y / (t - a))); elseif (t <= 3.3e+40) tmp = x + (y * (z / (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[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.2e+122], t$95$1, If[LessEqual[t, -2.95e-89], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.3e+40], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - y \cdot \frac{z}{t}\right)\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{+122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.95 \cdot 10^{-89}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{+40}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.20000000000000015e122 or 3.2999999999999998e40 < t Initial program 66.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 61.7%
mul-1-neg61.7%
associate-/l*92.1%
distribute-lft-neg-in92.1%
div-sub92.1%
sub-neg92.1%
*-inverses92.1%
metadata-eval92.1%
Simplified92.1%
Taylor expanded in z around 0 80.9%
mul-1-neg80.9%
associate-*r/92.1%
unsub-neg92.1%
Simplified92.1%
if -5.20000000000000015e122 < t < -2.9500000000000001e-89Initial program 98.3%
*-commutative98.3%
associate-/l*96.6%
Applied egg-rr96.6%
Taylor expanded in z around 0 87.2%
mul-1-neg87.2%
associate-/l*87.2%
distribute-lft-neg-out87.2%
*-commutative87.2%
Simplified87.2%
associate-*l/87.2%
frac-2neg87.2%
add-sqr-sqrt87.0%
sqrt-unprod87.2%
sqr-neg87.2%
sqrt-unprod0.0%
add-sqr-sqrt63.7%
distribute-rgt-neg-out63.7%
add-sqr-sqrt63.7%
sqrt-unprod63.7%
sqr-neg63.7%
sqrt-unprod0.0%
add-sqr-sqrt87.2%
sub-neg87.2%
distribute-neg-in87.2%
add-sqr-sqrt87.0%
sqrt-unprod87.2%
sqr-neg87.2%
sqrt-unprod0.0%
add-sqr-sqrt74.8%
add-sqr-sqrt74.8%
sqrt-unprod74.8%
sqr-neg74.8%
sqrt-unprod0.0%
add-sqr-sqrt87.2%
Applied egg-rr87.2%
*-commutative87.2%
associate-/l*87.2%
+-commutative87.2%
unsub-neg87.2%
Simplified87.2%
if -2.9500000000000001e-89 < t < 3.2999999999999998e40Initial program 98.7%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in z around inf 89.0%
associate-/l*87.4%
Simplified87.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.5e+96) (not (<= z 7.8e+26))) (+ x (* y (/ z (- a t)))) (+ x (* t (/ y (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.5e+96) || !(z <= 7.8e+26)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (t * (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 ((z <= (-3.5d+96)) .or. (.not. (z <= 7.8d+26))) then
tmp = x + (y * (z / (a - t)))
else
tmp = x + (t * (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 ((z <= -3.5e+96) || !(z <= 7.8e+26)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (t * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.5e+96) or not (z <= 7.8e+26): tmp = x + (y * (z / (a - t))) else: tmp = x + (t * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.5e+96) || !(z <= 7.8e+26)) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.5e+96) || ~((z <= 7.8e+26))) tmp = x + (y * (z / (a - t))); else tmp = x + (t * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.5e+96], N[Not[LessEqual[z, 7.8e+26]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+96} \lor \neg \left(z \leq 7.8 \cdot 10^{+26}\right):\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if z < -3.4999999999999999e96 or 7.8e26 < z Initial program 86.1%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around inf 82.2%
associate-/l*84.4%
Simplified84.4%
if -3.4999999999999999e96 < z < 7.8e26Initial program 87.3%
*-commutative87.3%
associate-/l*97.5%
Applied egg-rr97.5%
Taylor expanded in z around 0 78.1%
mul-1-neg78.1%
associate-/l*88.1%
distribute-lft-neg-out88.1%
*-commutative88.1%
Simplified88.1%
associate-*l/78.1%
frac-2neg78.1%
add-sqr-sqrt43.6%
sqrt-unprod56.7%
sqr-neg56.7%
sqrt-unprod22.8%
add-sqr-sqrt54.2%
distribute-rgt-neg-out54.2%
add-sqr-sqrt31.4%
sqrt-unprod54.8%
sqr-neg54.8%
sqrt-unprod34.3%
add-sqr-sqrt78.1%
sub-neg78.1%
distribute-neg-in78.1%
add-sqr-sqrt43.6%
sqrt-unprod64.9%
sqr-neg64.9%
sqrt-unprod24.4%
add-sqr-sqrt59.6%
add-sqr-sqrt35.2%
sqrt-unprod66.2%
sqr-neg66.2%
sqrt-unprod34.3%
add-sqr-sqrt78.1%
Applied egg-rr78.1%
*-commutative78.1%
associate-/l*88.1%
+-commutative88.1%
unsub-neg88.1%
Simplified88.1%
Final simplification86.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.95e-89) (not (<= t 4.8e-11))) (+ x (* t (/ y (- t a)))) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.95e-89) || !(t <= 4.8e-11)) {
tmp = x + (t * (y / (t - a)));
} 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 <= (-2.95d-89)) .or. (.not. (t <= 4.8d-11))) then
tmp = x + (t * (y / (t - a)))
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 <= -2.95e-89) || !(t <= 4.8e-11)) {
tmp = x + (t * (y / (t - a)));
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.95e-89) or not (t <= 4.8e-11): tmp = x + (t * (y / (t - a))) else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.95e-89) || !(t <= 4.8e-11)) tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); 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 <= -2.95e-89) || ~((t <= 4.8e-11))) tmp = x + (t * (y / (t - a))); else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.95e-89], N[Not[LessEqual[t, 4.8e-11]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.95 \cdot 10^{-89} \lor \neg \left(t \leq 4.8 \cdot 10^{-11}\right):\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -2.9500000000000001e-89 or 4.8000000000000002e-11 < t Initial program 79.5%
*-commutative79.5%
associate-/l*96.3%
Applied egg-rr96.3%
Taylor expanded in z around 0 71.2%
mul-1-neg71.2%
associate-/l*85.3%
distribute-lft-neg-out85.3%
*-commutative85.3%
Simplified85.3%
associate-*l/71.2%
frac-2neg71.2%
add-sqr-sqrt42.1%
sqrt-unprod47.5%
sqr-neg47.5%
sqrt-unprod18.6%
add-sqr-sqrt47.5%
distribute-rgt-neg-out47.5%
add-sqr-sqrt28.8%
sqrt-unprod42.1%
sqr-neg42.1%
sqrt-unprod28.9%
add-sqr-sqrt71.2%
sub-neg71.2%
distribute-neg-in71.2%
add-sqr-sqrt42.1%
sqrt-unprod58.5%
sqr-neg58.5%
sqrt-unprod19.8%
add-sqr-sqrt52.7%
add-sqr-sqrt32.9%
sqrt-unprod56.7%
sqr-neg56.7%
sqrt-unprod28.9%
add-sqr-sqrt71.2%
Applied egg-rr71.2%
*-commutative71.2%
associate-/l*85.3%
+-commutative85.3%
unsub-neg85.3%
Simplified85.3%
if -2.9500000000000001e-89 < t < 4.8000000000000002e-11Initial program 98.6%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in t around 0 84.7%
Final simplification85.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.8e+96) (+ x (/ y (/ (- a t) z))) (if (<= z 2.3e+48) (+ x (* y (/ t (- t a)))) (+ x (* y (/ z (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.8e+96) {
tmp = x + (y / ((a - t) / z));
} else if (z <= 2.3e+48) {
tmp = x + (y * (t / (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 (z <= (-6.8d+96)) then
tmp = x + (y / ((a - t) / z))
else if (z <= 2.3d+48) then
tmp = x + (y * (t / (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 (z <= -6.8e+96) {
tmp = x + (y / ((a - t) / z));
} else if (z <= 2.3e+48) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.8e+96: tmp = x + (y / ((a - t) / z)) elif z <= 2.3e+48: tmp = x + (y * (t / (t - a))) else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.8e+96) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); elseif (z <= 2.3e+48) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); 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 (z <= -6.8e+96) tmp = x + (y / ((a - t) / z)); elseif (z <= 2.3e+48) tmp = x + (y * (t / (t - a))); else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.8e+96], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e+48], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+96}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+48}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if z < -6.8000000000000002e96Initial program 84.9%
associate-/l*92.1%
Simplified92.1%
Taylor expanded in z around inf 82.7%
associate-/l*82.5%
Simplified82.5%
clear-num82.4%
un-div-inv84.5%
Applied egg-rr84.5%
if -6.8000000000000002e96 < z < 2.3e48Initial program 87.6%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in z around 0 78.0%
associate-*r/78.0%
mul-1-neg78.0%
distribute-lft-neg-out78.0%
*-commutative78.0%
associate-/l*90.1%
distribute-neg-frac90.1%
distribute-neg-frac290.1%
neg-sub090.1%
associate--r-90.1%
neg-sub090.1%
Simplified90.1%
if 2.3e48 < z Initial program 86.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around inf 82.8%
associate-/l*87.5%
Simplified87.5%
Final simplification88.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.1e+29) (not (<= t 5e-11))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.1e+29) || !(t <= 5e-11)) {
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 <= (-2.1d+29)) .or. (.not. (t <= 5d-11))) 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 <= -2.1e+29) || !(t <= 5e-11)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.1e+29) or not (t <= 5e-11): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.1e+29) || !(t <= 5e-11)) 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 <= -2.1e+29) || ~((t <= 5e-11))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.1e+29], N[Not[LessEqual[t, 5e-11]], $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 -2.1 \cdot 10^{+29} \lor \neg \left(t \leq 5 \cdot 10^{-11}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -2.1000000000000002e29 or 5.00000000000000018e-11 < t Initial program 74.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 78.1%
if -2.1000000000000002e29 < t < 5.00000000000000018e-11Initial program 98.9%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in t around 0 81.4%
Final simplification79.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8.8e+25) (not (<= t 4.8e-11))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8.8e+25) || !(t <= 4.8e-11)) {
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 <= (-8.8d+25)) .or. (.not. (t <= 4.8d-11))) 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 <= -8.8e+25) || !(t <= 4.8e-11)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8.8e+25) or not (t <= 4.8e-11): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8.8e+25) || !(t <= 4.8e-11)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -8.8e+25) || ~((t <= 4.8e-11))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8.8e+25], N[Not[LessEqual[t, 4.8e-11]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.8 \cdot 10^{+25} \lor \neg \left(t \leq 4.8 \cdot 10^{-11}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -8.8000000000000003e25 or 4.8000000000000002e-11 < t Initial program 74.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 78.1%
if -8.8000000000000003e25 < t < 4.8000000000000002e-11Initial program 98.9%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in t around 0 81.4%
associate-/l*79.4%
Simplified79.4%
Final simplification78.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.5e+27) (not (<= t 3.2e-142))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.5e+27) || !(t <= 3.2e-142)) {
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 ((t <= (-3.5d+27)) .or. (.not. (t <= 3.2d-142))) 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 ((t <= -3.5e+27) || !(t <= 3.2e-142)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.5e+27) or not (t <= 3.2e-142): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.5e+27) || !(t <= 3.2e-142)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.5e+27) || ~((t <= 3.2e-142))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.5e+27], N[Not[LessEqual[t, 3.2e-142]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+27} \lor \neg \left(t \leq 3.2 \cdot 10^{-142}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -3.5000000000000002e27 or 3.1999999999999998e-142 < t Initial program 78.7%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 74.4%
if -3.5000000000000002e27 < t < 3.1999999999999998e-142Initial program 98.7%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in z around inf 87.8%
associate-/l*85.3%
Simplified85.3%
Taylor expanded in x around inf 58.7%
Final simplification67.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 87.0%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in z around inf 71.2%
associate-/l*71.6%
Simplified71.6%
Taylor expanded in x around inf 51.5%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2024103
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))