
(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 15 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 (+ (/ y (/ (- z a) (- z t))) x))
double code(double x, double y, double z, double t, double a) {
return (y / ((z - a) / (z - t))) + 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 = (y / ((z - a) / (z - t))) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return (y / ((z - a) / (z - t))) + x;
}
def code(x, y, z, t, a): return (y / ((z - a) / (z - t))) + x
function code(x, y, z, t, a) return Float64(Float64(y / Float64(Float64(z - a) / Float64(z - t))) + x) end
function tmp = code(x, y, z, t, a) tmp = (y / ((z - a) / (z - t))) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{\frac{z - a}{z - t}} + x
\end{array}
Initial program 83.7%
+-commutative83.7%
associate-/l*98.4%
fma-define98.4%
Simplified98.4%
fma-undefine98.4%
Applied egg-rr98.4%
clear-num98.4%
un-div-inv98.5%
Applied egg-rr98.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -6.4e+102)
t_1
(if (<= z -1.04e-51)
(- x (* y (/ t z)))
(if (<= z 4.25e-66) (+ x (/ y (/ a t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -6.4e+102) {
tmp = t_1;
} else if (z <= -1.04e-51) {
tmp = x - (y * (t / z));
} else if (z <= 4.25e-66) {
tmp = x + (y / (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 / (z - a)))
if (z <= (-6.4d+102)) then
tmp = t_1
else if (z <= (-1.04d-51)) then
tmp = x - (y * (t / z))
else if (z <= 4.25d-66) then
tmp = x + (y / (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 / (z - a)));
double tmp;
if (z <= -6.4e+102) {
tmp = t_1;
} else if (z <= -1.04e-51) {
tmp = x - (y * (t / z));
} else if (z <= 4.25e-66) {
tmp = x + (y / (a / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -6.4e+102: tmp = t_1 elif z <= -1.04e-51: tmp = x - (y * (t / z)) elif z <= 4.25e-66: tmp = x + (y / (a / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a)))) tmp = 0.0 if (z <= -6.4e+102) tmp = t_1; elseif (z <= -1.04e-51) tmp = Float64(x - Float64(y * Float64(t / z))); elseif (z <= 4.25e-66) tmp = Float64(x + Float64(y / 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 / (z - a))); tmp = 0.0; if (z <= -6.4e+102) tmp = t_1; elseif (z <= -1.04e-51) tmp = x - (y * (t / z)); elseif (z <= 4.25e-66) tmp = x + (y / (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[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.4e+102], t$95$1, If[LessEqual[z, -1.04e-51], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.25e-66], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -6.4 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.04 \cdot 10^{-51}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 4.25 \cdot 10^{-66}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.3999999999999999e102 or 4.24999999999999983e-66 < z Initial program 73.1%
Taylor expanded in t around 0 65.8%
associate-/l*89.0%
Simplified89.0%
if -6.3999999999999999e102 < z < -1.0399999999999999e-51Initial program 83.2%
+-commutative83.2%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in a around 0 68.4%
+-commutative68.4%
associate-/l*74.1%
Simplified74.1%
Taylor expanded in z around 0 70.2%
neg-mul-170.2%
distribute-neg-frac270.2%
Simplified70.2%
if -1.0399999999999999e-51 < z < 4.24999999999999983e-66Initial program 94.0%
+-commutative94.0%
associate-/l*96.5%
fma-define96.5%
Simplified96.5%
fma-undefine96.5%
Applied egg-rr96.5%
clear-num96.4%
un-div-inv96.9%
Applied egg-rr96.9%
Taylor expanded in z around 0 83.1%
Final simplification83.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.6e+103)
(+ y x)
(if (<= z -4.8e-52)
(- x (* y (/ t z)))
(if (<= z 1.8e-30) (+ x (/ y (/ a t))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.6e+103) {
tmp = y + x;
} else if (z <= -4.8e-52) {
tmp = x - (y * (t / z));
} else if (z <= 1.8e-30) {
tmp = x + (y / (a / t));
} else {
tmp = y + 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 (z <= (-3.6d+103)) then
tmp = y + x
else if (z <= (-4.8d-52)) then
tmp = x - (y * (t / z))
else if (z <= 1.8d-30) then
tmp = x + (y / (a / t))
else
tmp = y + x
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.6e+103) {
tmp = y + x;
} else if (z <= -4.8e-52) {
tmp = x - (y * (t / z));
} else if (z <= 1.8e-30) {
tmp = x + (y / (a / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.6e+103: tmp = y + x elif z <= -4.8e-52: tmp = x - (y * (t / z)) elif z <= 1.8e-30: tmp = x + (y / (a / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.6e+103) tmp = Float64(y + x); elseif (z <= -4.8e-52) tmp = Float64(x - Float64(y * Float64(t / z))); elseif (z <= 1.8e-30) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.6e+103) tmp = y + x; elseif (z <= -4.8e-52) tmp = x - (y * (t / z)); elseif (z <= 1.8e-30) tmp = x + (y / (a / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.6e+103], N[(y + x), $MachinePrecision], If[LessEqual[z, -4.8e-52], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-30], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+103}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-52}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-30}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -3.60000000000000017e103 or 1.8000000000000002e-30 < z Initial program 70.4%
+-commutative70.4%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 86.7%
+-commutative86.7%
Simplified86.7%
if -3.60000000000000017e103 < z < -4.8000000000000003e-52Initial program 83.2%
+-commutative83.2%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in a around 0 68.4%
+-commutative68.4%
associate-/l*74.1%
Simplified74.1%
Taylor expanded in z around 0 70.2%
neg-mul-170.2%
distribute-neg-frac270.2%
Simplified70.2%
if -4.8000000000000003e-52 < z < 1.8000000000000002e-30Initial program 94.5%
+-commutative94.5%
associate-/l*96.8%
fma-define96.8%
Simplified96.8%
fma-undefine96.8%
Applied egg-rr96.8%
clear-num96.7%
un-div-inv97.1%
Applied egg-rr97.1%
Taylor expanded in z around 0 80.7%
Final simplification81.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4e+123)
(+ x (* y (/ z (- z a))))
(if (<= z 7e+109)
(+ x (/ (* y (- z t)) (- z a)))
(+ x (/ y (/ (- z a) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e+123) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 7e+109) {
tmp = x + ((y * (z - t)) / (z - a));
} else {
tmp = x + (y / ((z - 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 (z <= (-4d+123)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 7d+109) then
tmp = x + ((y * (z - t)) / (z - a))
else
tmp = x + (y / ((z - 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 (z <= -4e+123) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 7e+109) {
tmp = x + ((y * (z - t)) / (z - a));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4e+123: tmp = x + (y * (z / (z - a))) elif z <= 7e+109: tmp = x + ((y * (z - t)) / (z - a)) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e+123) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 7e+109) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4e+123) tmp = x + (y * (z / (z - a))); elseif (z <= 7e+109) tmp = x + ((y * (z - t)) / (z - a)); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e+123], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e+109], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+123}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+109}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if z < -3.99999999999999991e123Initial program 51.3%
Taylor expanded in t around 0 52.2%
associate-/l*92.0%
Simplified92.0%
if -3.99999999999999991e123 < z < 6.99999999999999966e109Initial program 93.2%
if 6.99999999999999966e109 < z Initial program 65.2%
+-commutative65.2%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
fma-undefine100.0%
Applied egg-rr100.0%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 95.7%
Final simplification93.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.2e-66) (not (<= z 2.5e-117))) (+ x (* y (/ (- z t) z))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.2e-66) || !(z <= 2.5e-117)) {
tmp = x + (y * ((z - t) / z));
} 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 <= (-4.2d-66)) .or. (.not. (z <= 2.5d-117))) then
tmp = x + (y * ((z - t) / z))
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 <= -4.2e-66) || !(z <= 2.5e-117)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.2e-66) or not (z <= 2.5e-117): tmp = x + (y * ((z - t) / z)) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.2e-66) || !(z <= 2.5e-117)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); 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 <= -4.2e-66) || ~((z <= 2.5e-117))) tmp = x + (y * ((z - t) / z)); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.2e-66], N[Not[LessEqual[z, 2.5e-117]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-66} \lor \neg \left(z \leq 2.5 \cdot 10^{-117}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -4.2000000000000001e-66 or 2.5e-117 < z Initial program 77.8%
+-commutative77.8%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 68.0%
+-commutative68.0%
associate-/l*86.1%
Simplified86.1%
if -4.2000000000000001e-66 < z < 2.5e-117Initial program 93.8%
+-commutative93.8%
associate-/l*95.8%
fma-define95.8%
Simplified95.8%
fma-undefine95.8%
Applied egg-rr95.8%
clear-num95.7%
un-div-inv96.3%
Applied egg-rr96.3%
Taylor expanded in z around 0 85.8%
Final simplification86.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.5e+82) (not (<= z 4.3e-30))) (+ y x) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.5e+82) || !(z <= 4.3e-30)) {
tmp = y + x;
} 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 <= (-7.5d+82)) .or. (.not. (z <= 4.3d-30))) then
tmp = y + x
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 <= -7.5e+82) || !(z <= 4.3e-30)) {
tmp = y + x;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.5e+82) or not (z <= 4.3e-30): tmp = y + x else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.5e+82) || !(z <= 4.3e-30)) tmp = Float64(y + x); 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 <= -7.5e+82) || ~((z <= 4.3e-30))) tmp = y + x; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.5e+82], N[Not[LessEqual[z, 4.3e-30]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+82} \lor \neg \left(z \leq 4.3 \cdot 10^{-30}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -7.4999999999999999e82 or 4.29999999999999966e-30 < z Initial program 71.3%
+-commutative71.3%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 85.3%
+-commutative85.3%
Simplified85.3%
if -7.4999999999999999e82 < z < 4.29999999999999966e-30Initial program 91.9%
+-commutative91.9%
associate-/l*97.4%
fma-define97.4%
Simplified97.4%
fma-undefine97.4%
Applied egg-rr97.4%
clear-num97.3%
un-div-inv97.6%
Applied egg-rr97.6%
Taylor expanded in z around 0 74.4%
Final simplification78.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.15e+86) (not (<= z 9e-32))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.15e+86) || !(z <= 9e-32)) {
tmp = y + x;
} 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 ((z <= (-2.15d+86)) .or. (.not. (z <= 9d-32))) then
tmp = y + x
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 ((z <= -2.15e+86) || !(z <= 9e-32)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.15e+86) or not (z <= 9e-32): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.15e+86) || !(z <= 9e-32)) tmp = Float64(y + x); 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 ((z <= -2.15e+86) || ~((z <= 9e-32))) tmp = y + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.15e+86], N[Not[LessEqual[z, 9e-32]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+86} \lor \neg \left(z \leq 9 \cdot 10^{-32}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.1500000000000001e86 or 9.00000000000000009e-32 < z Initial program 71.3%
+-commutative71.3%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 85.3%
+-commutative85.3%
Simplified85.3%
if -2.1500000000000001e86 < z < 9.00000000000000009e-32Initial program 91.9%
+-commutative91.9%
associate-/l*97.4%
fma-define97.4%
Simplified97.4%
fma-undefine97.4%
Applied egg-rr97.4%
Taylor expanded in z around 0 74.2%
Final simplification78.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.5e+82) (not (<= z 8.8e-32))) (+ y x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.5e+82) || !(z <= 8.8e-32)) {
tmp = y + x;
} 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 <= (-9.5d+82)) .or. (.not. (z <= 8.8d-32))) then
tmp = y + x
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 <= -9.5e+82) || !(z <= 8.8e-32)) {
tmp = y + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.5e+82) or not (z <= 8.8e-32): tmp = y + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.5e+82) || !(z <= 8.8e-32)) tmp = Float64(y + x); 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 <= -9.5e+82) || ~((z <= 8.8e-32))) tmp = y + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.5e+82], N[Not[LessEqual[z, 8.8e-32]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+82} \lor \neg \left(z \leq 8.8 \cdot 10^{-32}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -9.50000000000000049e82 or 8.7999999999999999e-32 < z Initial program 71.3%
+-commutative71.3%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 85.3%
+-commutative85.3%
Simplified85.3%
if -9.50000000000000049e82 < z < 8.7999999999999999e-32Initial program 91.9%
+-commutative91.9%
associate-/l*97.4%
fma-define97.4%
Simplified97.4%
Taylor expanded in z around 0 69.3%
+-commutative69.3%
associate-/l*73.2%
Simplified73.2%
Final simplification78.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.8e-64) (not (<= z 4.7e-30))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.8e-64) || !(z <= 4.7e-30)) {
tmp = y + x;
} 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 ((z <= (-2.8d-64)) .or. (.not. (z <= 4.7d-30))) then
tmp = y + x
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 ((z <= -2.8e-64) || !(z <= 4.7e-30)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.8e-64) or not (z <= 4.7e-30): tmp = y + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.8e-64) || !(z <= 4.7e-30)) tmp = Float64(y + x); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.8e-64) || ~((z <= 4.7e-30))) tmp = y + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.8e-64], N[Not[LessEqual[z, 4.7e-30]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-64} \lor \neg \left(z \leq 4.7 \cdot 10^{-30}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -2.80000000000000004e-64 or 4.69999999999999969e-30 < z Initial program 74.8%
+-commutative74.8%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 74.0%
+-commutative74.0%
Simplified74.0%
if -2.80000000000000004e-64 < z < 4.69999999999999969e-30Initial program 94.2%
Taylor expanded in z around 0 77.8%
Final simplification75.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.8e+201) (not (<= t 1.25e+146))) (* t (/ y a)) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.8e+201) || !(t <= 1.25e+146)) {
tmp = t * (y / a);
} else {
tmp = y + 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 <= (-2.8d+201)) .or. (.not. (t <= 1.25d+146))) then
tmp = t * (y / a)
else
tmp = y + 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 <= -2.8e+201) || !(t <= 1.25e+146)) {
tmp = t * (y / a);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.8e+201) or not (t <= 1.25e+146): tmp = t * (y / a) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.8e+201) || !(t <= 1.25e+146)) tmp = Float64(t * Float64(y / a)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.8e+201) || ~((t <= 1.25e+146))) tmp = t * (y / a); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.8e+201], N[Not[LessEqual[t, 1.25e+146]], $MachinePrecision]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+201} \lor \neg \left(t \leq 1.25 \cdot 10^{+146}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -2.80000000000000005e201 or 1.25e146 < t Initial program 81.7%
+-commutative81.7%
associate-/l*94.9%
fma-define94.9%
Simplified94.9%
Taylor expanded in y around -inf 61.7%
Taylor expanded in z around 0 45.1%
associate-/l*51.5%
Simplified51.5%
if -2.80000000000000005e201 < t < 1.25e146Initial program 84.3%
+-commutative84.3%
associate-/l*99.5%
fma-define99.5%
Simplified99.5%
Taylor expanded in z around inf 70.6%
+-commutative70.6%
Simplified70.6%
Final simplification66.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.4e+140) (* y (/ (- z t) z)) (if (<= t 1.25e+146) (+ y x) (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.4e+140) {
tmp = y * ((z - t) / z);
} else if (t <= 1.25e+146) {
tmp = y + x;
} else {
tmp = 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 (t <= (-2.4d+140)) then
tmp = y * ((z - t) / z)
else if (t <= 1.25d+146) then
tmp = y + x
else
tmp = 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 (t <= -2.4e+140) {
tmp = y * ((z - t) / z);
} else if (t <= 1.25e+146) {
tmp = y + x;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.4e+140: tmp = y * ((z - t) / z) elif t <= 1.25e+146: tmp = y + x else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.4e+140) tmp = Float64(y * Float64(Float64(z - t) / z)); elseif (t <= 1.25e+146) tmp = Float64(y + x); else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.4e+140) tmp = y * ((z - t) / z); elseif (t <= 1.25e+146) tmp = y + x; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.4e+140], N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e+146], N[(y + x), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+140}:\\
\;\;\;\;y \cdot \frac{z - t}{z}\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+146}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -2.4e140Initial program 73.4%
+-commutative73.4%
associate-/l*97.2%
fma-define97.2%
Simplified97.2%
Taylor expanded in y around -inf 55.6%
Taylor expanded in a around 0 42.8%
associate-/l*49.5%
Simplified49.5%
if -2.4e140 < t < 1.25e146Initial program 85.4%
+-commutative85.4%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 72.4%
+-commutative72.4%
Simplified72.4%
if 1.25e146 < t Initial program 84.8%
+-commutative84.8%
associate-/l*90.9%
fma-define90.9%
Simplified90.9%
Taylor expanded in y around -inf 63.6%
Taylor expanded in z around 0 55.0%
associate-/l*58.0%
Simplified58.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -4.5e+175) y (if (<= y 4e+89) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.5e+175) {
tmp = y;
} else if (y <= 4e+89) {
tmp = x;
} else {
tmp = 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 (y <= (-4.5d+175)) then
tmp = y
else if (y <= 4d+89) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.5e+175) {
tmp = y;
} else if (y <= 4e+89) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -4.5e+175: tmp = y elif y <= 4e+89: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.5e+175) tmp = y; elseif (y <= 4e+89) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -4.5e+175) tmp = y; elseif (y <= 4e+89) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.5e+175], y, If[LessEqual[y, 4e+89], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+175}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+89}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -4.49999999999999989e175 or 3.99999999999999998e89 < y Initial program 58.5%
+-commutative58.5%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around -inf 47.2%
Taylor expanded in z around inf 38.9%
if -4.49999999999999989e175 < y < 3.99999999999999998e89Initial program 94.5%
+-commutative94.5%
associate-/l*97.8%
fma-define97.8%
Simplified97.8%
Taylor expanded in y around 0 61.3%
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 83.7%
+-commutative83.7%
associate-/l*98.4%
fma-define98.4%
Simplified98.4%
fma-undefine98.4%
Applied egg-rr98.4%
Final simplification98.4%
(FPCore (x y z t a) :precision binary64 (if (<= a 4.3e+206) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 4.3e+206) {
tmp = y + x;
} 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 <= 4.3d+206) then
tmp = y + x
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 <= 4.3e+206) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 4.3e+206: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 4.3e+206) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 4.3e+206) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 4.3e+206], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.3 \cdot 10^{+206}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 4.29999999999999988e206Initial program 84.3%
+-commutative84.3%
associate-/l*98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in z around inf 61.5%
+-commutative61.5%
Simplified61.5%
if 4.29999999999999988e206 < a Initial program 76.0%
+-commutative76.0%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around 0 72.2%
(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 83.7%
+-commutative83.7%
associate-/l*98.4%
fma-define98.4%
Simplified98.4%
Taylor expanded in y around 0 48.4%
(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 2024100
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))