
(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}
Sampling outcomes in binary64 precision:
Herbie found 9 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(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}
(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 97.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.4e-36)
(+ x y)
(if (<= z 4.2e-92)
(+ x (* t (/ y a)))
(if (<= z 1.02e+58) (- x (* y (/ t z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.4e-36) {
tmp = x + y;
} else if (z <= 4.2e-92) {
tmp = x + (t * (y / a));
} else if (z <= 1.02e+58) {
tmp = x - (y * (t / 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 (z <= (-3.4d-36)) then
tmp = x + y
else if (z <= 4.2d-92) then
tmp = x + (t * (y / a))
else if (z <= 1.02d+58) then
tmp = x - (y * (t / 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 (z <= -3.4e-36) {
tmp = x + y;
} else if (z <= 4.2e-92) {
tmp = x + (t * (y / a));
} else if (z <= 1.02e+58) {
tmp = x - (y * (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.4e-36: tmp = x + y elif z <= 4.2e-92: tmp = x + (t * (y / a)) elif z <= 1.02e+58: tmp = x - (y * (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.4e-36) tmp = Float64(x + y); elseif (z <= 4.2e-92) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 1.02e+58) tmp = Float64(x - Float64(y * Float64(t / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.4e-36) tmp = x + y; elseif (z <= 4.2e-92) tmp = x + (t * (y / a)); elseif (z <= 1.02e+58) tmp = x - (y * (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.4e-36], N[(x + y), $MachinePrecision], If[LessEqual[z, 4.2e-92], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e+58], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-36}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-92}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+58}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -3.4000000000000003e-36 or 1.02000000000000005e58 < z Initial program 99.9%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6481.0%
Simplified81.0%
if -3.4000000000000003e-36 < z < 4.2e-92Initial program 94.6%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6481.7%
Simplified81.7%
if 4.2e-92 < z < 1.02000000000000005e58Initial program 99.7%
Taylor expanded in z around inf
associate-+r+N/A
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-rgt-out--N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
Simplified62.3%
Taylor expanded in t around inf
/-lowering-/.f6467.3%
Simplified67.3%
Taylor expanded in y around 0
Simplified59.5%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.5e-73) (+ x y) (if (<= z 6e-226) x (if (<= z 7.2e-174) (/ (* y t) a) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.5e-73) {
tmp = x + y;
} else if (z <= 6e-226) {
tmp = x;
} else if (z <= 7.2e-174) {
tmp = (y * t) / 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 (z <= (-2.5d-73)) then
tmp = x + y
else if (z <= 6d-226) then
tmp = x
else if (z <= 7.2d-174) then
tmp = (y * t) / 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 (z <= -2.5e-73) {
tmp = x + y;
} else if (z <= 6e-226) {
tmp = x;
} else if (z <= 7.2e-174) {
tmp = (y * t) / a;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.5e-73: tmp = x + y elif z <= 6e-226: tmp = x elif z <= 7.2e-174: tmp = (y * t) / a else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.5e-73) tmp = Float64(x + y); elseif (z <= 6e-226) tmp = x; elseif (z <= 7.2e-174) tmp = Float64(Float64(y * t) / a); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.5e-73) tmp = x + y; elseif (z <= 6e-226) tmp = x; elseif (z <= 7.2e-174) tmp = (y * t) / a; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.5e-73], N[(x + y), $MachinePrecision], If[LessEqual[z, 6e-226], x, If[LessEqual[z, 7.2e-174], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-73}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-226}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-174}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.4999999999999999e-73 or 7.19999999999999997e-174 < z Initial program 99.3%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6474.3%
Simplified74.3%
if -2.4999999999999999e-73 < z < 5.9999999999999999e-226Initial program 94.3%
Taylor expanded in x around inf
Simplified56.9%
if 5.9999999999999999e-226 < z < 7.19999999999999997e-174Initial program 92.1%
Taylor expanded in z around 0
/-lowering-/.f6463.0%
Simplified63.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6454.7%
Simplified54.7%
Final simplification68.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- (+ x y) (* y (/ t z))))) (if (<= z -1.65e-74) t_1 (if (<= z 4.2e-92) (+ x (* t (/ y a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (y * (t / z));
double tmp;
if (z <= -1.65e-74) {
tmp = t_1;
} else if (z <= 4.2e-92) {
tmp = x + (t * (y / a));
} 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 * (t / z))
if (z <= (-1.65d-74)) then
tmp = t_1
else if (z <= 4.2d-92) then
tmp = x + (t * (y / a))
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 * (t / z));
double tmp;
if (z <= -1.65e-74) {
tmp = t_1;
} else if (z <= 4.2e-92) {
tmp = x + (t * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - (y * (t / z)) tmp = 0 if z <= -1.65e-74: tmp = t_1 elif z <= 4.2e-92: tmp = x + (t * (y / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(y * Float64(t / z))) tmp = 0.0 if (z <= -1.65e-74) tmp = t_1; elseif (z <= 4.2e-92) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - (y * (t / z)); tmp = 0.0; if (z <= -1.65e-74) tmp = t_1; elseif (z <= 4.2e-92) tmp = x + (t * (y / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.65e-74], t$95$1, If[LessEqual[z, 4.2e-92], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - y \cdot \frac{t}{z}\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{-74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-92}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.64999999999999998e-74 or 4.2e-92 < z Initial program 99.3%
Taylor expanded in z around inf
associate-+r+N/A
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-rgt-out--N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
Simplified80.9%
Taylor expanded in t around inf
/-lowering-/.f6484.1%
Simplified84.1%
if -1.64999999999999998e-74 < z < 4.2e-92Initial program 95.2%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6483.4%
Simplified83.4%
Final simplification83.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (* y (- 1.0 (/ t z)))))) (if (<= z -3.3e-75) t_1 (if (<= z 3.7e-92) (+ x (* t (/ y a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (1.0 - (t / z)));
double tmp;
if (z <= -3.3e-75) {
tmp = t_1;
} else if (z <= 3.7e-92) {
tmp = x + (t * (y / a));
} 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 - (t / z)))
if (z <= (-3.3d-75)) then
tmp = t_1
else if (z <= 3.7d-92) then
tmp = x + (t * (y / a))
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 - (t / z)));
double tmp;
if (z <= -3.3e-75) {
tmp = t_1;
} else if (z <= 3.7e-92) {
tmp = x + (t * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (1.0 - (t / z))) tmp = 0 if z <= -3.3e-75: tmp = t_1 elif z <= 3.7e-92: tmp = x + (t * (y / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))) tmp = 0.0 if (z <= -3.3e-75) tmp = t_1; elseif (z <= 3.7e-92) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (1.0 - (t / z))); tmp = 0.0; if (z <= -3.3e-75) tmp = t_1; elseif (z <= 3.7e-92) tmp = x + (t * (y / a)); 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[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.3e-75], t$95$1, If[LessEqual[z, 3.7e-92], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-92}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.3e-75 or 3.69999999999999977e-92 < z Initial program 99.3%
Taylor expanded in a around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
*-inversesN/A
--lowering--.f64N/A
/-lowering-/.f6484.0%
Simplified84.0%
if -3.3e-75 < z < 3.69999999999999977e-92Initial program 95.2%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6483.4%
Simplified83.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.5e-34) (+ x y) (if (<= z 4.2e-92) (+ x (* t (/ y a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e-34) {
tmp = x + y;
} else if (z <= 4.2e-92) {
tmp = x + (t * (y / 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 (z <= (-5.5d-34)) then
tmp = x + y
else if (z <= 4.2d-92) then
tmp = x + (t * (y / 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 (z <= -5.5e-34) {
tmp = x + y;
} else if (z <= 4.2e-92) {
tmp = x + (t * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.5e-34: tmp = x + y elif z <= 4.2e-92: tmp = x + (t * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e-34) tmp = Float64(x + y); elseif (z <= 4.2e-92) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.5e-34) tmp = x + y; elseif (z <= 4.2e-92) tmp = x + (t * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e-34], N[(x + y), $MachinePrecision], If[LessEqual[z, 4.2e-92], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-34}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-92}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -5.50000000000000014e-34 or 4.2e-92 < z Initial program 99.9%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6474.9%
Simplified74.9%
if -5.50000000000000014e-34 < z < 4.2e-92Initial program 94.6%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6481.7%
Simplified81.7%
Final simplification77.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.9e-73) (+ x y) (if (<= z 1.4e-174) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-73) {
tmp = x + y;
} else if (z <= 1.4e-174) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.9d-73)) then
tmp = x + y
else if (z <= 1.4d-174) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-73) {
tmp = x + y;
} else if (z <= 1.4e-174) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.9e-73: tmp = x + y elif z <= 1.4e-174: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e-73) tmp = Float64(x + y); elseif (z <= 1.4e-174) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.9e-73) tmp = x + y; elseif (z <= 1.4e-174) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e-73], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.4e-174], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-73}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-174}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.9000000000000001e-73 or 1.39999999999999999e-174 < z Initial program 99.3%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6473.9%
Simplified73.9%
if -1.9000000000000001e-73 < z < 1.39999999999999999e-174Initial program 93.9%
Taylor expanded in x around inf
Simplified51.7%
Final simplification67.2%
(FPCore (x y z t a) :precision binary64 (if (<= x -4.9e-197) x (if (<= x 2.9e-235) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -4.9e-197) {
tmp = x;
} else if (x <= 2.9e-235) {
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 <= (-4.9d-197)) then
tmp = x
else if (x <= 2.9d-235) 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 <= -4.9e-197) {
tmp = x;
} else if (x <= 2.9e-235) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -4.9e-197: tmp = x elif x <= 2.9e-235: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -4.9e-197) tmp = x; elseif (x <= 2.9e-235) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -4.9e-197) tmp = x; elseif (x <= 2.9e-235) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -4.9e-197], x, If[LessEqual[x, 2.9e-235], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.9 \cdot 10^{-197}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-235}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.9000000000000002e-197 or 2.90000000000000009e-235 < x Initial program 97.3%
Taylor expanded in x around inf
Simplified60.8%
if -4.9000000000000002e-197 < x < 2.90000000000000009e-235Initial program 99.7%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6446.4%
Simplified46.4%
Taylor expanded in y around inf
Simplified42.3%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 97.7%
Taylor expanded in x around inf
Simplified52.5%
(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 2024152
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (* y (/ (- z t) (- z a)))))