
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- 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 99.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- x (* y (+ -1.0 (/ z t)))))) (if (<= t -4e-57) t_1 (if (<= t 4.5e-100) (+ x (/ y (/ a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * (-1.0 + (z / t)));
double tmp;
if (t <= -4e-57) {
tmp = t_1;
} else if (t <= 4.5e-100) {
tmp = x + (y / (a / 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 * ((-1.0d0) + (z / t)))
if (t <= (-4d-57)) then
tmp = t_1
else if (t <= 4.5d-100) then
tmp = x + (y / (a / 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 * (-1.0 + (z / t)));
double tmp;
if (t <= -4e-57) {
tmp = t_1;
} else if (t <= 4.5e-100) {
tmp = x + (y / (a / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * (-1.0 + (z / t))) tmp = 0 if t <= -4e-57: tmp = t_1 elif t <= 4.5e-100: tmp = x + (y / (a / z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(-1.0 + Float64(z / t)))) tmp = 0.0 if (t <= -4e-57) tmp = t_1; elseif (t <= 4.5e-100) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * (-1.0 + (z / t))); tmp = 0.0; if (t <= -4e-57) tmp = t_1; elseif (t <= 4.5e-100) tmp = x + (y / (a / 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[(-1.0 + N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4e-57], t$95$1, If[LessEqual[t, 4.5e-100], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \left(-1 + \frac{z}{t}\right)\\
\mathbf{if}\;t \leq -4 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-100}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.99999999999999982e-57 or 4.5000000000000001e-100 < t Initial program 99.9%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6481.2%
Simplified81.2%
if -3.99999999999999982e-57 < t < 4.5000000000000001e-100Initial program 98.8%
Taylor expanded in t around 0
/-lowering-/.f6487.8%
Simplified87.8%
+-commutativeN/A
+-lowering-+.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6487.9%
Applied egg-rr87.9%
Final simplification83.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.8e+43) (+ x y) (if (<= t 8.8e-60) (+ x (/ y (/ a z))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.8e+43) {
tmp = x + y;
} else if (t <= 8.8e-60) {
tmp = x + (y / (a / z));
} 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 (t <= (-3.8d+43)) then
tmp = x + y
else if (t <= 8.8d-60) then
tmp = x + (y / (a / z))
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 (t <= -3.8e+43) {
tmp = x + y;
} else if (t <= 8.8e-60) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.8e+43: tmp = x + y elif t <= 8.8e-60: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.8e+43) tmp = Float64(x + y); elseif (t <= 8.8e-60) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.8e+43) tmp = x + y; elseif (t <= 8.8e-60) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.8e+43], N[(x + y), $MachinePrecision], If[LessEqual[t, 8.8e-60], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+43}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{-60}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.80000000000000008e43 or 8.7999999999999995e-60 < t Initial program 99.9%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6474.7%
Simplified74.7%
if -3.80000000000000008e43 < t < 8.7999999999999995e-60Initial program 99.1%
Taylor expanded in t around 0
/-lowering-/.f6479.3%
Simplified79.3%
+-commutativeN/A
+-lowering-+.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6479.3%
Applied egg-rr79.3%
Final simplification77.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.4e+42) (+ x y) (if (<= t 9.6e-61) (+ x (* y (/ z a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.4e+42) {
tmp = x + y;
} else if (t <= 9.6e-61) {
tmp = x + (y * (z / a));
} 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 (t <= (-2.4d+42)) then
tmp = x + y
else if (t <= 9.6d-61) then
tmp = x + (y * (z / a))
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 (t <= -2.4e+42) {
tmp = x + y;
} else if (t <= 9.6e-61) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.4e+42: tmp = x + y elif t <= 9.6e-61: tmp = x + (y * (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.4e+42) tmp = Float64(x + y); elseif (t <= 9.6e-61) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.4e+42) tmp = x + y; elseif (t <= 9.6e-61) tmp = x + (y * (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.4e+42], N[(x + y), $MachinePrecision], If[LessEqual[t, 9.6e-61], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+42}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 9.6 \cdot 10^{-61}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.3999999999999999e42 or 9.6000000000000004e-61 < t Initial program 99.9%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6474.7%
Simplified74.7%
if -2.3999999999999999e42 < t < 9.6000000000000004e-61Initial program 99.1%
Taylor expanded in t around 0
/-lowering-/.f6479.3%
Simplified79.3%
Final simplification77.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* z (/ y (- a t))))) (if (<= z -6e+122) t_1 (if (<= z 1.25e+53) (+ x y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / (a - t));
double tmp;
if (z <= -6e+122) {
tmp = t_1;
} else if (z <= 1.25e+53) {
tmp = x + y;
} 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 = z * (y / (a - t))
if (z <= (-6d+122)) then
tmp = t_1
else if (z <= 1.25d+53) then
tmp = x + y
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 = z * (y / (a - t));
double tmp;
if (z <= -6e+122) {
tmp = t_1;
} else if (z <= 1.25e+53) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (y / (a - t)) tmp = 0 if z <= -6e+122: tmp = t_1 elif z <= 1.25e+53: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / Float64(a - t))) tmp = 0.0 if (z <= -6e+122) tmp = t_1; elseif (z <= 1.25e+53) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (y / (a - t)); tmp = 0.0; if (z <= -6e+122) tmp = t_1; elseif (z <= 1.25e+53) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e+122], t$95$1, If[LessEqual[z, 1.25e+53], N[(x + y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{a - t}\\
\mathbf{if}\;z \leq -6 \cdot 10^{+122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+53}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.99999999999999972e122 or 1.2500000000000001e53 < z Initial program 98.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6461.6%
Simplified61.6%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6472.0%
Applied egg-rr72.0%
Taylor expanded in z around inf
Simplified65.7%
if -5.99999999999999972e122 < z < 1.2500000000000001e53Initial program 99.9%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6473.8%
Simplified73.8%
Final simplification70.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.3e+125) (/ y (/ a z)) (if (<= z 4.4e+244) (+ x y) (* y (- 1.0 (/ z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.3e+125) {
tmp = y / (a / z);
} else if (z <= 4.4e+244) {
tmp = x + y;
} else {
tmp = y * (1.0 - (z / 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 <= (-3.3d+125)) then
tmp = y / (a / z)
else if (z <= 4.4d+244) then
tmp = x + y
else
tmp = y * (1.0d0 - (z / 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 <= -3.3e+125) {
tmp = y / (a / z);
} else if (z <= 4.4e+244) {
tmp = x + y;
} else {
tmp = y * (1.0 - (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.3e+125: tmp = y / (a / z) elif z <= 4.4e+244: tmp = x + y else: tmp = y * (1.0 - (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.3e+125) tmp = Float64(y / Float64(a / z)); elseif (z <= 4.4e+244) tmp = Float64(x + y); else tmp = Float64(y * Float64(1.0 - Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.3e+125) tmp = y / (a / z); elseif (z <= 4.4e+244) tmp = x + y; else tmp = y * (1.0 - (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.3e+125], N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e+244], N[(x + y), $MachinePrecision], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+125}:\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+244}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\
\end{array}
\end{array}
if z < -3.30000000000000005e125Initial program 97.3%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6469.7%
Simplified69.7%
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6475.2%
Applied egg-rr75.2%
Taylor expanded in t around 0
/-lowering-/.f6458.5%
Simplified58.5%
if -3.30000000000000005e125 < z < 4.40000000000000003e244Initial program 99.9%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6465.3%
Simplified65.3%
if 4.40000000000000003e244 < z Initial program 99.9%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6480.5%
Simplified80.5%
Taylor expanded in x around 0
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f6480.5%
Simplified80.5%
Final simplification65.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.05e+125) (/ y (/ a z)) (if (<= z 2.75e+243) (+ x y) (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e+125) {
tmp = y / (a / z);
} else if (z <= 2.75e+243) {
tmp = x + y;
} else {
tmp = z * (y / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.05d+125)) then
tmp = y / (a / z)
else if (z <= 2.75d+243) then
tmp = x + y
else
tmp = z * (y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e+125) {
tmp = y / (a / z);
} else if (z <= 2.75e+243) {
tmp = x + y;
} else {
tmp = z * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.05e+125: tmp = y / (a / z) elif z <= 2.75e+243: tmp = x + y else: tmp = z * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e+125) tmp = Float64(y / Float64(a / z)); elseif (z <= 2.75e+243) tmp = Float64(x + y); else tmp = Float64(z * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.05e+125) tmp = y / (a / z); elseif (z <= 2.75e+243) tmp = x + y; else tmp = z * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e+125], N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.75e+243], N[(x + y), $MachinePrecision], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+125}:\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{+243}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.05e125Initial program 97.3%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6469.7%
Simplified69.7%
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6475.2%
Applied egg-rr75.2%
Taylor expanded in t around 0
/-lowering-/.f6458.5%
Simplified58.5%
if -1.05e125 < z < 2.75000000000000002e243Initial program 99.9%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6465.3%
Simplified65.3%
if 2.75000000000000002e243 < z Initial program 99.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6468.7%
Simplified68.7%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in z around inf
Simplified91.2%
Taylor expanded in a around inf
Simplified53.9%
Final simplification63.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* z (/ y a)))) (if (<= z -1.52e+125) t_1 (if (<= z 5.4e+244) (+ x y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / a);
double tmp;
if (z <= -1.52e+125) {
tmp = t_1;
} else if (z <= 5.4e+244) {
tmp = x + y;
} 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 = z * (y / a)
if (z <= (-1.52d+125)) then
tmp = t_1
else if (z <= 5.4d+244) then
tmp = x + y
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 = z * (y / a);
double tmp;
if (z <= -1.52e+125) {
tmp = t_1;
} else if (z <= 5.4e+244) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (y / a) tmp = 0 if z <= -1.52e+125: tmp = t_1 elif z <= 5.4e+244: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / a)) tmp = 0.0 if (z <= -1.52e+125) tmp = t_1; elseif (z <= 5.4e+244) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (y / a); tmp = 0.0; if (z <= -1.52e+125) tmp = t_1; elseif (z <= 5.4e+244) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.52e+125], t$95$1, If[LessEqual[z, 5.4e+244], N[(x + y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{a}\\
\mathbf{if}\;z \leq -1.52 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+244}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.5199999999999999e125 or 5.39999999999999995e244 < z Initial program 98.1%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6469.4%
Simplified69.4%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6480.6%
Applied egg-rr80.6%
Taylor expanded in z around inf
Simplified76.1%
Taylor expanded in a around inf
Simplified55.2%
if -1.5199999999999999e125 < z < 5.39999999999999995e244Initial program 99.9%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6465.3%
Simplified65.3%
Final simplification63.3%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.18e-113) x (if (<= x 3.7e-140) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.18e-113) {
tmp = x;
} else if (x <= 3.7e-140) {
tmp = 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 (x <= (-1.18d-113)) then
tmp = x
else if (x <= 3.7d-140) then
tmp = 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 (x <= -1.18e-113) {
tmp = x;
} else if (x <= 3.7e-140) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.18e-113: tmp = x elif x <= 3.7e-140: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.18e-113) tmp = x; elseif (x <= 3.7e-140) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.18e-113) tmp = x; elseif (x <= 3.7e-140) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.18e-113], x, If[LessEqual[x, 3.7e-140], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.18 \cdot 10^{-113}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-140}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.18e-113 or 3.69999999999999977e-140 < x Initial program 99.9%
Taylor expanded in x around inf
Simplified61.1%
if -1.18e-113 < x < 3.69999999999999977e-140Initial program 98.5%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6479.6%
Simplified79.6%
Taylor expanded in t around inf
Simplified36.2%
(FPCore (x y z t a) :precision binary64 (if (<= a 4.9e+135) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 4.9e+135) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= 4.9d+135) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 4.9e+135) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 4.9e+135: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 4.9e+135) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 4.9e+135) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 4.9e+135], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.9 \cdot 10^{+135}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 4.9000000000000001e135Initial program 99.5%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6459.6%
Simplified59.6%
if 4.9000000000000001e135 < a Initial program 99.8%
Taylor expanded in x around inf
Simplified59.8%
Final simplification59.6%
(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 99.5%
Taylor expanded in x around inf
Simplified46.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y * ((z - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024160
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (if (< y -8508084860551241/100000000000000000000000000000000) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t)))))))
(+ x (* y (/ (- z t) (- a t)))))